Open wlatic opened 4 years ago
I will have the option for case sensitive, as well working on the SetOption19 will post the update ASAP
thanks Thiru
Really good work on this. Got the Home assistant config ready if you wanted to publish to the wiki.
The only issue I can really see now is:
It also appears that currently power1 ON toggles the light, just as power1 OFF does. This means you can turn off the light (if it is on) using power1 ON.
UPPER is to support the Tasmota MQTT setup working to support with and without case sensitive, Yes the it always toggle the status, I will post the update asap,
Please share or submit pull request on the Wiki for HA
Thanks
Pushed the changes,
Check and let me know, any issue
Thanks Thiru
The light still appears to be toggling when passing:
root@aml:~# mosquitto_pub -h 127.0.0.1 -t cmnd/bedroomlight/power1 -m OFF root@aml:~# mosquitto_pub -h 127.0.0.1 -t cmnd/bedroomlight/power1 -m OFF
Will check into the setoptions19 and autodiscovery by home assistant later tonight. Again great work with this, made it so much easier to do localtuya!
Full run of the command and the output in debug console: command issued: mosquitto_pub -h 127.0.0.1 -t cmnd/bedroomlight/power1 -m OFF Light status currently on.
Jun-11-2019 8:36:22 AM Mqtt message device ID 1 Jun-11-2019 8:36:22 AM Utility.updateDevStatus --> setData: : {"multiple":true,"data":{"1":false}} Jun-11-2019 8:36:23 AM Data from device:: {"devId":"22025072b4e62d617dbf","dps":{"1":false},"t":1562808981} Jun-11-2019 8:36:23 AM called processData: for bedroomlight: {"devId":"22025072b4e62d617dbf","dps":{"1":false},"t":1562808981} Jun-11-2019 8:36:23 AM Publish Mqtt:: {"type":"Result","value":"{\"power1\" : \"OFF\"}","isHa":true,"nodeId":"bedroomlight","param":""} Jun-11-2019 8:36:23 AM Publish Mqtt:: {"type":"Power","value":"OFF","isHa":true,"nodeId":"bedroomlight","param":"1"}
To me this means your Virtual Tasmota isnt at fault but the tuyapi itself.
Did you ever look into devices turning off and on when submitting just the power off?
@wlatic, Yes now the latest code has setoption 19 to send the mqtt in lowercase
Worked through a problem I had and found that the commands passed to Virtual Tasmota via MQTT must be lower case.
cmnd/bedroomlight/power1 ON (works) cmnd/bedroomlight/POWER1 ON (Doesn't)
It also appears that currently power1 ON toggles the light, just ad power1 OFF does. This means you can turn off the light (if it is on) using power1 ON.
This applies to dimmer and teleperiod, however RESULT and STATE are maintained as capitals.