Heatzy et Domoticz

Forum destiné aux questions sur Desbian ou Raspbian
Avatar du membre
christophe
MyEleec de Platine LV2
MyEleec de Platine LV2
Messages : 12457
Enregistré le : mai 14, '07, 10:29
Discipline : Electrotechnique
Académie : Créteil
Qui êtes vous ? : Enseignant
Localisation : Seine et marne
A remercié : 167 fois
A été remercié : 207 fois
Contact :

Heatzy et Domoticz

Message non lu par christophe »

Bonjour à tous.
Pour ceux que ça intéresse, j'ai mis en place un Domoticz sur un Rapsberry.

Aujourd'hui, j'ai réussi à piloter un module Heatzy via Domoticz. Pour cela, j'ai suivi le tuto (sans images ...) suivant :
Pilotez Vos Modules Heatzy Pilot V1 Avec Domoticz

Rien de compliqué à mon gout, il suffit de bien suivre ce qu'il dit. Finalement, on peut se passer des images.

Sauf qu'à la fin, ça ne marche pas :hehe:
Je récupère bien le Token, mais lorsque j'envoie un ordre au module Heatzy, ce dernier ne réagit pas.

On trouve la solution dans les commentaires du site :
Frederic B a écrit : 21 janvier 2019 à 19 h 13 min
Je m’auto réponds 😉
j’ai modifié le script initial que vous pourrez trouver ici :
https://easydomoticz.com/forum/viewtopi ... 619#p64619
Il faut remplacer le script de contrôle par celui-là :

Code : Tout sélectionner

--script pilotant les modules fils pilote heatzy

--Variable a personnaliser
did = 'TON DID' -- entre les '  '' --que tu recuperes avec la commande : "curl -X GET --header 'Accept: application/json' --header 'X-Gizwits-User-token: quicetrouvedanstavariableutilisateurdomoticzheatzytoken' --header 'X-Gizwits-Application-Id: c70a66ff039d41b4a220e198b0fcc8b3' 'https://euapi.gizwits.com/app/bindings?limit=20&skip=0'
selectorheatzy = 'Heatzy Salon' --ici le nom de ton selector entre les '  '
vartoken = 'heatzytoken' -- ici le nom de ta variable utilisateur de type chaîne que tu as créer pour recevoir le token entre les '  '

--Fin des variable a personnaliser


token = tostring(uservariables[vartoken])
--Confort = '[1,1,0]'   
--Eco = '[1,1,1]' 
--Hors_Gel = '[1,1,2]'
--Off = '[1,1,3]'


---
commandArray = {}
--Off
if devicechanged[selectorheatzy] == 'Off' then
    
    runcommand = "curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Gizwits-User-token: "..token.."' --header 'X-Gizwits-Application-Id: c70a66ff039d41b4a220e198b0fcc8b3' -d '{\"attrs\": {\"mode\":\"stop\"}}' 'https://euapi.gizwits.com/app/control/"..did.."'";
    os.execute(runcommand);
   --print(runcommand)
   
--Confort
elseif devicechanged[selectorheatzy] == 'Confort' then
    --print(..token..)
    runcommand = "curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Gizwits-User-token: "..token.."' --header 'X-Gizwits-Application-Id: c70a66ff039d41b4a220e198b0fcc8b3' -d '{\"attrs\": {\"mode\":\"cft\"}}' 'https://euapi.gizwits.com/app/control/"..did.."'";
    os.execute(runcommand);
   --print(runcommand)

--Eco
elseif devicechanged[selectorheatzy] == 'Eco' then
    --print(..token..)
    runcommand = "curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Gizwits-User-token: "..token.."' --header 'X-Gizwits-Application-Id: c70a66ff039d41b4a220e198b0fcc8b3' -d '{\"attrs\": {\"mode\":\"eco\"}}' 'https://euapi.gizwits.com/app/control/"..did.."'";
    os.execute(runcommand);
   --print(runcommand)

--Horsgel
elseif devicechanged[selectorheatzy] == 'Hors Gel' then
    --print(..token..)
    runcommand = "curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Gizwits-User-token: "..token.."' --header 'X-Gizwits-Application-Id: c70a66ff039d41b4a220e198b0fcc8b3' -d '{\"attrs\": {\"mode\":\"fro\"}}' 'https://euapi.gizwits.com/app/control/"..did.."'";
    os.execute(runcommand);
   --print(runcommand)
   
end
return commandArray
Voilà,
si vous voulez tenter le tuto, n'hésitez pas à demander de l'aide sur le forum :)
À vaincre sans péril, on triomphe sans gloire.
Image Image Image Image Image Image
Avatar du membre
Riton-2B
MyEleec d'Or 22c LV5
MyEleec d'Or 22c LV5
Messages : 2079
Enregistré le : juil. 4, '11, 08:33
Discipline : BAC PRO MELEC et MSPC
Académie : Corse
Qui êtes vous ? : Enseignant
Localisation : BASTIA
A remercié : 15 fois
A été remercié : 41 fois

Re: Heatzy et Domoticz

Message non lu par Riton-2B »

Christophe,
J'admire ton abnégation.
A+
Image Image
La difficulté commence là où le savoir s'arrête
Répondre

Retourner vers « Desbian / Raspbian »