joba-1 / Tasmoticz

Domoticz MQTT autodiscovery plugin for Tasmota devices
MIT License
25 stars 18 forks source link

Add Dimmer support #2

Open joba-1 opened 5 years ago

ledfreak3d commented 4 years ago

any updates on this one yet

Markjgabb commented 4 years ago

happy to assist with logs on this one if it will help... i have a heap of TUYA devices flashed with tasmota, that the new firmware doesnt work like the old one (no domoticz section) so would be happy to provide any and all details requested

joba-1 commented 4 years ago

I dont have dimmers, so what I need is mqtt messages during start of dimmer, some normal tele messages and ideally mqtt messages to and from domoticz while operated from domoticz (switch on, off, set dimmer level).

dbrb2 commented 3 years ago

Is the below any use? This shows a dimmer switch being turned on, the dim changed, then turned off, all from within Domoticz. This was with SetOption19 1 though, so it may not help you?

` 23:04:29 MQT: bathroom_light/stat/RESULT = {"POWER":"ON"} 23:04:29 MQT: bathroom_light/stat/POWER = ON (retained)

23:04:42 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:42","Uptime":"0T00:07:15","UptimeSec":435,"Heap":22,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":57,"MqttCount":1,"POWER":"ON","Dimmer":45,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}}

23:04:42 MQT: bathroom_light/stat/RESULT = {"POWER":"ON","Dimmer":45} 23:04:42 Script: performs "SerialSend5 FF556305DC0A" 23:04:42 MQT: bathroom_light/stat/RESULT = {"SerialSend":"Done"} 23:04:42 Script: performs "Dimmer 45.00" 23:04:42 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:42","Uptime":"0T00:07:15","UptimeSec":435,"Heap":20,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":57,"MqttCount":1,"POWER":"ON","Dimmer":45,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}}

23:04:42 MQT: bathroom_light/stat/RESULT = {"POWER":"ON","Dimmer":45} 23:04:45 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:45","Uptime":"0T00:07:18","UptimeSec":438,"Heap":22,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":72,"MqttCount":1,"POWER":"ON","Dimmer":81,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}}

23:04:45 MQT: bathroom_light/stat/RESULT = {"POWER":"ON","Dimmer":81} 23:04:45 Script: performs "SerialSend5 FF55b205DC0A" 23:04:45 MQT: bathroom_light/stat/RESULT = {"SerialSend":"Done"} 23:04:45 Script: performs "Dimmer 81.00" 23:04:45 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:45","Uptime":"0T00:07:18","UptimeSec":438,"Heap":20,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":72,"MqttCount":1,"POWER":"ON","Dimmer":81,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}}

23:04:45 MQT: bathroom_light/stat/RESULT = {"POWER":"ON","Dimmer":81} 23:04:48 var not found: Dimmer 23:04:48 Script: performs "SerialSend5 FF550005DC0A" 23:04:48 MQT: bathroom_light/stat/RESULT = {"SerialSend":"Done"} 23:04:48 Script: performs "Dimmer 0.00" 23:04:48 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:48","Uptime":"0T00:07:21","UptimeSec":441,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":87,"MqttCount":1,"POWER":"OFF","Dimmer":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}}

23:04:48 MQT: bathroom_light/stat/RESULT = {"POWER":"OFF","Dimmer":0} 23:04:48 MQT: bathroom_light/tele/STATE = {"Time":"2021-01-19T23:04:48","Uptime":"0T00:07:21","UptimeSec":441,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":87,"MqttCount":1,"POWER":"OFF","Dimmer":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:8D:C2:7C","Channel":1,"RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:09"}} 23:04:48 MQT: bathroom_light/stat/RESULT = {"POWER":"OFF"} 23:04:48 MQT: bathroom_light/stat/POWER = OFF (retained) `

thatguyinoz commented 2 years ago

Im happy to provide whatever debug/logs are needed as I have a number of different dimmer and colour dimmer lights. eg "simple" dimmer:

mosquitto_pub -d -h 127.0.0.1 -p 1883 -t 'tam6_FrontDoor/cmnd/Dimmer' -m '10'
tam6_FrontDoor/stat/RESULT = {"POWER":"ON","Dimmer":10}
mosquitto_pub -d -h 127.0.0.1 -p 1883 -t 'tam6_FrontDoor/cmnd/POWER' -m 'ON'
tam6_FrontDoor/stat/RESULT = {"POWER":"ON"}

adding the domoticz IDX (333) to the tasmota device "IDX1" field and changing settings using the tasmota webgui controls: mosquitto_sub -v -d -h 127.0.0.1 -p 1883 -t 'domoticz/in/#'|grep 333

power toggle was ON, and I dragged the slider up to 10% domoticz/in {"idx":333,"nvalue":1,"svalue":"10","Battery":100,"RSSI":4} power toggle was OFF, and I dragged the slider up to 10% domoticz/in {"idx":333,"nvalue":0,"svalue":"10","Battery":100,"RSSI":4} power toggle was ON, and I dragged the slider up to 21% domoticz/in {"idx":333,"nvalue":1,"svalue":"21","Battery":100,"RSSI":4} power toggle was OFF, and I changed toggle to ON domoticz/in {"idx":333,"nvalue":1,"svalue":"21","Battery":100,"RSSI":4} power toggle was ON, and I changed toggle to OFF domoticz/in {"idx":333,"nvalue":0,"svalue":"21","Battery":100,"RSSI":4}

Please let me know whatever specific logs you require to move this forward.

kind regards

thatguyinoz commented 2 years ago

Typical teleperiod string: tam6_FrontDoor/tele/STATE {"Time":"2022-08-19T00:34:15","Uptime":"0T00:14:41","UptimeSec":881,"Heap":26,"SleepMode":"Dyna mic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":9,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1, "SSId":"Bman_net","BSSId":"78:45:58:83:74:77","Channel":3,"Mode":"11n","RSSI":44,"Signal":-78,"LinkCount":1,"Downtime":"0 T00:00:05"}}

thatguyinoz commented 2 years ago

Domoticz does no longer sends dimmer data for any devices set as "Dimmer" but the general format of all device status updates is:

domoticz/out/6tamala/Kitchen { "Battery" : 255, "LastUpdate" : "2022-08-19 00:37:56", "RSSI" : 12, "description" : "Controlicz: Coffee Machine\nTypeControl: Switch", "dtype" : "Light/Switch", "hwid" : "3", "id" : "00014181", "idx" : 305, "name" : "Isomac", "nvalue" : 1, "stype" : "Switch", "svalue1" : "0", "switchType" : "On/Off", "unit" : 1 } I assume that stype would need to match whatever a dimmer is, and nvalue is power on/off (1/0) svalue1 = 0-100 (as a percentage)