Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Météo openweathermap
#11
Salut,
Désolé j'ai raté ton post...

Bref, ton probleme dans le script LUA c'est que tu essayes de comparer une chaine de caractere avec une valeur entiere, d'ou l'erreur.

Ce que tu dois faire, c'est utiliser une variable Web Analog Input pour la direction du vent. Tu peux la mettre en visible=false pour la cacher sur l'interface. Ensuite une variable interne String, pour afficher la valeur textuelle de la direction du vent (ce que tu veux au final). Celle la doit etre a visible=true.

Pour le script, c'etait bon sauf pour les id qui doivent etre utilisé. Il faut lire la valeur en degré qui se trouve dans la web analog_input et ecrire le texte dans l'internal string.

Tu dois faire ca dans ton script:
Code:
local wind_direction = calaos:getInputValue("id_du_web_amalog_input")
if wind_direction >= 0 and wind_direction < 45 then
-- Nord
str = "Nord"
elseif wind_direction >= 315 and wind_direction < 0 then
-- Nord
str = "Nord"
elseif wind_direction >= 45 and wind_direction < 135 then
-- Est
str = "Est"
elseif wind_direction >= 135 and wind_direction < 225 then
-- Sud
str = "Sud"
elseif wind_direction >= 225 and wind_direction < 315 then
-- Ouest
str = "Ouest"

end
calaos:setOutputValue("id_du_internal_string", str)
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply


Messages In This Thread
Météo openweathermap - by Eric64 - 11-05-2014, 06:35 PM
RE: Météo openweathermap - by azerty - 11-05-2014, 07:11 PM
RE: Météo openweathermap - by captainigloo - 11-05-2014, 10:45 PM
RE: Météo openweathermap - by ActionProd - 01-02-2015, 03:23 PM
RE: Météo openweathermap - by Eric64 - 01-26-2015, 09:17 PM
RE: Météo openweathermap - by captainigloo - 01-26-2015, 09:44 PM
RE: Météo openweathermap - by Eric64 - 01-28-2015, 03:18 PM
RE: Météo openweathermap - by Eric64 - 01-30-2015, 11:32 PM
RE: Météo openweathermap - by Eric64 - 02-06-2015, 11:56 AM
RE: Météo openweathermap - by Eric64 - 03-11-2015, 05:03 PM
RE: Météo openweathermap - by raoulh - 03-12-2015, 09:43 AM
RE: Météo openweathermap - by Eric64 - 03-13-2015, 10:20 AM
RE: Météo openweathermap - by Eric64 - 03-23-2015, 07:24 PM
RE: Météo openweathermap - by raoulh - 03-23-2015, 08:46 PM
RE: Météo openweathermap - by Eric64 - 03-25-2015, 08:51 AM
RE: Météo openweathermap - by raoulh - 03-25-2015, 09:32 AM
RE: Météo openweathermap - by Eric64 - 03-25-2015, 02:28 PM
RE: Météo openweathermap - by Eric64 - 03-29-2015, 12:38 PM
RE: Météo openweathermap - by Eric64 - 05-15-2015, 02:50 PM
RE: Météo openweathermap - by Cyridle - 05-22-2015, 08:40 AM
RE: Météo openweathermap - by Eric64 - 05-26-2015, 10:14 PM
RE: Météo openweathermap - by Cyridle - 05-28-2015, 04:36 PM
RE: Météo openweathermap - by bernievds - 02-01-2017, 10:08 PM
RE: Météo openweathermap - by raoulh - 02-02-2017, 10:34 AM
RE: Météo openweathermap - by bernievds - 02-02-2017, 11:03 AM
RE: Météo openweathermap - by raoulh - 02-02-2017, 11:08 AM
RE: Météo openweathermap - by davidinfo - 02-05-2017, 01:58 AM
RE: Météo openweathermap - by bernievds - 02-13-2017, 07:39 PM
RE: Météo openweathermap - by davidinfo - 02-17-2017, 12:03 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)