Page 6 sur 24

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 20:26
par jackslayter
Dans les rules du wemos j'ai des sendhttp en /json.htm?type=command&param=switchlight&idx=99&switchcmd=On qui marche très bien par contre /json.htm?type=command&param=switchlight&idx=IDX&switchcmd=Set%20Level&level=LEVEL ne marche pas. Une idée ? J'ai essayé en mettant un espace à la place du %20, sans changement. Bien sur le lien marche dans un navigateur.

Re: RE: Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 20:35
par dokho
jackslayter a écrit :Dans les rules du wemos j'ai des sendhttp en /json.htm?type=command&param=switchlight&idx=99&switchcmd=On qui marche très bien par contre /json.htm?type=command&param=switchlight&idx=IDX&switchcmd=Set%20Level&level=LEVEL ne marche pas. Une idée ? J'ai essayé en mettant un espace à la place du %20, sans changement. Bien sur le lien marche dans un navigateur.
Oui, j'ai eu le même problème.

Je ne suis pas chez moi donc je n'ai pas le truc sous les yeux mais il faut modifier l'url en mettant le switchcmd=Set%20Level en 1er après ?type

Si tu ne t'en sors pas je regarde en rentrant

Envoyé de mon SM-N9005 en utilisant Tapatalk

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 20:51
par Jeff
Je t'avoue que j'ai passé 3h sur le sujet hier en voulant absolument mettre le plugin Nextion sur la version 2.0.0 dev12.
Et la le bug des Sentohttp mais avec les "On" de base, il ne veut pas des "&" entre "command&param...". Je n'ai pas trouvé pourquoi...
Moi je n 'y arrive pas du tout, pas comme toi, cela résume les 3h d'hier :x

Bref mon cerveau a tilté et je suis passé par du MQTT et j'ai abandonné les envoi par http et maintenant je fais cela qui marche pour moi avec des "On":

Code : Tout sélectionner

on NEXTION#code=4.00 do // Lumiere buanderie Off
Publish domoticz/in,{"command": "switchlight", "idx": 52, "switchcmd": "Off", "level": 100}
endon
Je viens de regarder, apparemment on ne peut pas dupliquer pour les levels, c'est ici, essaye !
https://www.domoticz.com/wiki/MQTT
Sending a Switch Command
Optional: level (not when switchcmd = "Set Level")

{"command": "switchlight", "idx": 2450, "switchcmd": "On", "level": 100 }
Edit :
Cela marche en fait, il y a une decalage de 1%, testé sur 50% (49%) et 20%(19%) !

Code : Tout sélectionner

Publish domoticz/in,{"command": "switchlight", "idx": 189, "switchcmd": "Set Level", "level": 50}

Code : Tout sélectionner

2017-10-18 20:58:31.037 MQTT: Topic: domoticz/in, Message: {"command": "switchlight", "idx": 189, "switchcmd": "Set Level", "level": 50}

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 21:01
par jackslayter
Au début cela ne marchait pas et ça c'est mis à marcher même si dans le log j'ai des erreurs de réponse JSON

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 21:04
par Jeff
Cela marche chez toi en Http ou en MQTT ?
Regarde j'ai réédité mon post, cela marche nickel en MQTT en fait :D

Re: RE: Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 21:14
par jackslayter
dokho a écrit :
jackslayter a écrit :Dans les rules du wemos j'ai des sendhttp en /json.htm?type=command&param=switchlight&idx=99&switchcmd=On qui marche très bien par contre /json.htm?type=command&param=switchlight&idx=IDX&switchcmd=Set%20Level&level=LEVEL ne marche pas. Une idée ? J'ai essayé en mettant un espace à la place du %20, sans changement. Bien sur le lien marche dans un navigateur.
Oui, j'ai eu le même problème.

Je ne suis pas chez moi donc je n'ai pas le truc sous les yeux mais il faut modifier l'url en mettant le switchcmd=Set%20Level en 1er après ?type

Si tu ne t'en sors pas je regarde en rentrant

Envoyé de mon SM-N9005 en utilisant Tapatalk
Non pas d'amélioration

Ça marche en http mais en switch on off seulement

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 21:17
par Jeff
Moi je n'ai plus de problème, je m'en suis sorti avec le MQTT en Publish et comme je te disais cela marche avec les Set Level.
Quand tu rentreras tu liras mon post au dessus ;)

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 18 oct. 2017, 21:58
par dokho
on NEXTION#idx=273 do
sendtohttp 192.168.0.232,8080,/json.htm?param=switchlight&type=command&idx=847&switchcmd=Set%20Level&level=10
endon
mais je suis aussi passé en MQTT que je trouve plus réactif ;)

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 19 oct. 2017, 20:39
par jackslayter
Bon ba ça marche pas, je vais passer par un script.

Re: TUTO Esp Easy + Nextion + Domoticz

Publié : 19 oct. 2017, 20:41
par dokho
C'est étrange, ça fonctionne chez moi pour un interrupteur sélecteur

Envoyé de mon SM-N9005 en utilisant Tapatalk