joba-1 / Tasmoticz

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

more than 3 power #13

Closed megamarco833 closed 4 years ago

megamarco833 commented 4 years ago

hi thanks for support domoticz and tasmota, great idea! i have a nodemcu plus two pcf8574 to control 16 channel relay, so i have 16 power: from power1 to power16 in tasmota i see that only first three are recognized...can you please extend the support to all possible power that can tasmota have? thanks so much!!

joba-1 commented 4 years ago

Hi @megamarco833

thanks for your interest.

My long term goal is to support all features of tasmota. But...

So generally your best option is a pull request with tested code.

Your issue definitely raised priority though... :)

megamarco833 commented 4 years ago

Hi, thanks. But... I'm not able to modify your code to add more than 3 relays that are now supported.... So you can't add more relays in your code? :)

joba-1 commented 4 years ago

I think I could :) But I will need your support: Please post a STATE line from the console log of your „more-than-three“-relay device. I expect a lot of POWERn entries, but I need to know the exact format, especially if n>9. And once I changed the code in a branch, you need to download, test and report. Ok?

megamarco833 commented 4 years ago

Oh yes, absolutely! That's fantastic. I can also test the blind script if you want to port it. I build also this architecture with 8ch relay on(4 blinds) in a pcf8574 and 8 switch input to control with wall swith. Unfortunately this can not ported in domoticz, but if you want we can also test it. But step by step:) We will start with relay "n" :) Let me come back at home and i'll give you the info requested. If you want we can also chat on discord to be more efficient

megamarco833 commented 4 years ago

I think I could :) But I will need your support: Please post a STATE line from the console log of your „more-than-three“-relay device. I expect a lot of POWERn entries, but I need to know the exact format, especially if n>9. And once I changed the code in a branch, you need to download, test and report. Ok?

18:30:39 CMD: power15 1
18:30:39 MQT: stat/tasmota_esp_160/RESULT = {"POWER15":"ON"}
18:30:39 MQT: stat/tasmota_esp_160/POWER18 = ON
18:30:45 CMD: power7 1
18:30:45 MQT: stat/tasmota_esp_160/RESULT = {"POWER7":"ON"}
18:30:45 MQT: stat/tasmota_esp_160/POWER19 = ON
18:30:52 CMD: power20 1
18:30:52 MQT: stat/tasmota_esp_160/RESULT = {"POWER20":"ON"}
18:30:52 MQT: stat/tasmota_esp_160/POWER20 = ON
18:31:02 CMD: power4 1
18:31:02 MQT: stat/tasmota_esp_160/RESULT = {"POWER4":"ON"}
18:31:02 MQT: stat/tasmota_esp_160/POWER21 = ON
18:31:08 CMD: power13 1
18:31:08 MQT: stat/tasmota_esp_160/RESULT = {"POWER13":"ON"}
18:31:08 MQT: stat/tasmota_esp_160/POWER22 = ON

i so not see any difference compare to relay1 (power1) or power2 or power3 usage that are already supported by your script. so could you please extend the support with many power ? :D thanks if you need something different just let me know! thanks

megamarco833 commented 4 years ago

I think I could :) But I will need your support: Please post a STATE line from the console log of your „more-than-three“-relay device. I expect a lot of POWERn entries, but I need to know the exact format, especially if n>9. And once I changed the code in a branch, you need to download, test and report. Ok?

Hi, what i reported fits what you requested? :-) if not, just let me know and i'll do other tests

joba-1 commented 4 years ago

it fits. And I have an idea on what to change - probably very simple. Just don't have the time to follow up fast...

megamarco833 commented 4 years ago

Of course not a problem...!! It's open source word :-) Just let me know if you need support in terms of test or whatever. I implemented also the blinds control, should be something similar, but we will see, if you want of course, and step by step :-)

joba-1 commented 4 years ago

I just pushed a new branch "more_power".

The new code should handle up to POWER32 (I think 32 is a tasmota limit anyways). Feel free to test and report.

I use friendly names as Domoticz device names, if available. Last time I checked, tasmota supported up to 3 friendly names only. Do you know if that increased?

megamarco833 commented 4 years ago

Hi! Thanks for that, tomorrow i'll try. Correct max 32 power output are supported. And now 8 friendly name, not 3 :-)

megamarco833 commented 4 years ago

hi, i tested the script, but the devices are not recognized: here my tasmota mqtt settingd immagine here the tasmota friendly names: immagine

23:05:27 MQT: stat/tasmota_156/POWER12 = ON
23:05:29 MQT: stat/tasmota_156/RESULT = {"POWER12":"OFF"}
23:05:29 MQT: stat/tasmota_156/POWER12 = OFF
23:05:30 MQT: stat/tasmota_156/RESULT = {"POWER9":"ON"}
23:05:30 MQT: stat/tasmota_156/POWER9 = ON
23:05:32 MQT: stat/tasmota_156/RESULT = {"POWER9":"OFF"}
23:05:32 MQT: stat/tasmota_156/POWER9 = OFF
 2020-05-12 13:31:04.913 Status: (tasmota more power) Started.
2020-05-12 13:31:05.336 Status: (tasmota more power) Entering work loop.
2020-05-12 13:31:05.337 Status: (tasmota more power) Initialized version 1.3.1, author 'Joachim Banzhaf'

immagine finally here the configuration.

i think that is done all properly, but please check. the issue is that inside switches there aren't the new tasmota associated powers... thanks!

megamarco833 commented 4 years ago

sorry, i'm donkey :) i wrote inconsistenly inside domotic the subscription of tasmota! it is: %prefix%/tasmota_156

but now it discover only three devices: immagine

i have 16 power devices (only 8 can be set as friendly names, see picture post above please) but i should recognise 16 power device, right?

immagine

joba-1 commented 4 years ago

Yes, all should have been discovered. Luckily there is only one place in my code where I handle power1-3 differently from the others. Let me check. If I can't spot it, a full tasmota console log and domoticz log (preferably debug level) during a new discovery could help.

megamarco833 commented 4 years ago

ok, so what do you prefere? i will test the new release when you will be ready? and if it will be not working i'll provide the output logs of tasmota and domoticz?

joba-1 commented 4 years ago

I don't see why my code should stop discovery after 3 devices. To debug this, I now have pushed a change that should handle a 4th friendly name where it has been three. Please attach the logs from domoticz start (to see my plugins startup messages, domoticz- and python version) and during discovery (should include messages beginning like "Handler::onMQTTPublish: topic:")

megamarco833 commented 4 years ago
Version: 2020.2 (build 12003)
Build Hash: 212462a03
Compile Date: 2020-04-29 23:02:39
dzVents Version: 3.0.3
Python Version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]

at this time all 16 devices are discovered....

immagine

only strange things are the names assigned immagine from idx181 to 183 they are the tasmota friendly name from 184 to the end they are the same suffix of "luce camino" plus the number. not an issue because i can change the names inside domoticz and the code still works

here the logs in debug mode:

2020-05-13 17:32:21.809 Status: Closing application!...
2020-05-13 17:32:21.809 Status: Stopping worker...
2020-05-13 17:32:44.965 Status: Domoticz V2020.2 (build 12003) (c)2012-2020 GizMoCuz
2020-05-13 17:32:44.965 Status: Build Hash: 212462a03, Date: 2020-04-29 23:02:39
2020-05-13 17:32:44.966 Status: Startup Path: /home/pi/domoticz/
2020-05-13 17:32:45.311 Status: PluginSystem: Started, Python version '3.7.3'.
2020-05-13 17:32:45.315 Status: Using 1-Wire support (kernel W1 module)...
2020-05-13 17:32:45.350 Status: WebServer(HTTP) started on address: :: with port 8085
2020-05-13 17:32:45.376 Status: WebServer(SSL) started on address: :: with port 443
2020-05-13 17:32:45.387 Status: TCPServer: shared server started...
2020-05-13 17:32:45.388 Status: RxQueue: queue worker started...
2020-05-13 17:32:46.841 Status: Incoming connection from: 192.168.0.196
2020-05-13 17:32:47.389 Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!
2020-05-13 17:32:47.397 Status: 1Wire: Added Device: 28-0000074930a1
2020-05-13 17:32:47.397 Status: 1Wire: Added Device: 28-0000074881f9
2020-05-13 17:32:47.397 Status: 1Wire: Added Device: 28-00000746702d
2020-05-13 17:32:48.397 Status: MQTT: Connecting to localhost:1883
2020-05-13 17:32:48.601 Status: MQTT: connected to: localhost:1883
2020-05-13 17:32:48.802 Status: MQTT: Subscribed
2020-05-13 17:32:48.965 Status: Incoming connection from: 192.168.0.195
2020-05-13 17:32:50.088 Status: Kodi: Started
2020-05-13 17:32:50.089 Status: WOL: Started
2020-05-13 17:32:50.089 Status: YeeLight Worker started...
2020-05-13 17:32:50.089 Status: (tasmota more power) Started.
2020-05-13 17:32:50.089 Status: NotificationSystem: thread started...
2020-05-13 17:32:50.090 Status: EventSystem: reset all events...
2020-05-13 17:32:50.098 Status: PluginSystem: Entering work loop.
2020-05-13 17:32:50.103 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/ciclo_dzvents.lua
2020-05-13 17:32:50.105 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/ping.lua
2020-05-13 17:32:50.106 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/espLight2.lua
2020-05-13 17:32:50.106 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/PDC_valvole_AUTO.lua
2020-05-13 17:32:50.107 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/check_esp205_TreVie_Reboot.lua
2020-05-13 17:32:50.107 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/Valvola_TreVie_tempACS2.lua
2020-05-13 17:32:50.108 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/metern_import.lua
2020-05-13 17:32:50.115 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/PWM_resistenza_ACS.lua
2020-05-13 17:32:50.116 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/yeelight_scenario.lua
2020-05-13 17:32:50.117 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/IFTTT.lua
2020-05-13 17:32:50.118 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/check_esp204_VALVOLE.lua
2020-05-13 17:32:50.118 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/Stufa_pellet_telecomando3.lua
2020-05-13 17:32:50.119 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/ping_MeterN.lua
2020-05-13 17:32:50.119 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/thermostat2_caldaia.lua
2020-05-13 17:32:50.120 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/ftpbackup_check.lua
2020-05-13 17:32:50.121 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/OTTIMIZZAZIONE PDC_EST_INV.lua
2020-05-13 17:32:50.122 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/ftpbackup.lua
2020-05-13 17:32:50.123 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/tap12_dzvent3.lua
2020-05-13 17:32:50.124 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/tap_tasmota_dzvent3.lua
2020-05-13 17:32:50.125 Status: EventSystem: reset all device statuses...
2020-05-13 17:32:51.265 Status: Python EventSystem: Initalizing event module.
2020-05-13 17:32:51.266 Status: EventSystem: Started
2020-05-13 17:32:51.266 Status: EventSystem: Queue thread started...
2020-05-13 17:32:51.627 Status: dzVents: Info: Handling events for: "Accumulo solare", value: "43.9"
2020-05-13 17:32:51.660 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2020-05-13 17:32:52.051 Status: dzVents: Info: Handling events for: "Accumulo solare", value: "43.9"
2020-05-13 17:32:52.079 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2020-05-13 17:33:00.630 Status: dzVents: Info: cycling: ------ Start internal script: ciclo_dzvents:, trigger: "every 3 minutes at 06:30-01:00 on mon,tue,wed,thu,fri"
2020-05-13 17:33:00.633 Status: dzVents: Debug: cycling: Processing device-adapter for Pompa Ricircolo: Switch device adapter
2020-05-13 17:33:00.633 Status: dzVents: Debug: cycling: Trigger: every 3 minutes at 06:30-01:00 on mon,tue,wed,thu,fri
2020-05-13 17:33:00.638 Status: dzVents: Debug: cycling: Processing device-adapter for sospendi_dzvent_pompa: Switch device adapter
2020-05-13 17:33:00.638 Status: dzVents: Info: cycling: ------ Finished ciclo_dzvents
2020-05-13 17:33:00.905 Status: dzVents: Info: : ------ Start internal script: ping:, trigger: "every 3 minutes"
2020-05-13 17:33:00.942 Status: dzVents: Debug: ping: Checking 192.168.0.198
2020-05-13 17:33:00.980 Status: dzVents: Debug: ping: Checking 192.168.0.197
2020-05-13 17:33:01.018 Status: dzVents: Debug: ping: Checking 192.168.0.206
2020-05-13 17:33:01.059 Status: dzVents: Debug: ping: Checking 192.168.0.199
2020-05-13 17:33:01.104 Status: dzVents: Debug: ping: Checking 192.168.0.207
2020-05-13 17:33:01.150 Status: dzVents: Debug: ping: Checking 192.168.0.205
2020-05-13 17:33:01.208 Status: dzVents: Debug: ping: Checking 192.168.0.201
2020-05-13 17:33:01.266 Status: dzVents: Debug: ping: Checking 192.168.0.195
2020-05-13 17:33:02.045 Status: Set UserVariable hotWaterThermostatControlled = false
2020-05-13 17:33:02.046 Status: Set UserVariable PDC_manuale = 0
2020-05-13 17:33:11.383 Status: Incoming connection from: 192.168.0.205
2020-05-13 17:33:11.704 Status: dzVents: Info: Handling events for: "Temp_ACS", value: "55.70"
2020-05-13 17:33:11.735 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2020-05-13 17:33:37.151 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=180, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=1, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER1", ["lastUpdate"]=""}
2020-05-13 17:33:37.156 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=181, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=2, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER2", ["lastUpdate"]=""}
2020-05-13 17:33:37.159 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=182, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=3, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER3", ["lastUpdate"]=""}
2020-05-13 17:33:37.163 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=183, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=4, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER4", ["lastUpdate"]=""}
2020-05-13 17:33:37.166 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=184, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=5, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER5", ["lastUpdate"]=""}
2020-05-13 17:33:37.170 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=185, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=6, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=0, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER6", ["lastUpdate"]=""}
2020-05-13 17:33:37.174 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["timedOut"]=true, ["deviceType"]="Light/Switch", ["id"]=186, ["protected"]=false, ["switchTypeValue"]=0, ["baseType"]="device", ["deviceID"]="", ["changed"]=true, ["subType"]="Switch", ["data"]={["hardwareTypeValue"]=94, ["hardwareName"]="tasmota more power", ["usedByCamera"]=false, ["levelVal"]=0, ["_nValue"]=0, ["icon"]="lightbulb", ["hardwareType"]="Autodiscovery of Tasmota Devices", ["protected"]=false, ["_state"]="Off", ["hardwareID"]=2378232, ["unit"]=7, ["maxDimLevel"]=100}, ["switchType"]="On/Off", ["batteryLevel"]=1957746456, ["signalLevel"]=11230008, ["lastLevel"]=255, ["description"]="", ["rawData"]={"Off"}, ["name"]="tasmota_156 POWER7", ["lastUpdate"]=""}
2020-05-13 17:33:37.743 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=8, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER8", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=187}
2020-05-13 17:33:37.747 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=9, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER9", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=188}
2020-05-13 17:33:37.751 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=10, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER10", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=189}
2020-05-13 17:33:37.754 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=11, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER11", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=190}
2020-05-13 17:33:37.758 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=12, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER12", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=191}
2020-05-13 17:33:37.762 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=13, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER13", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=192}
2020-05-13 17:33:38.228 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=14, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER14", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=193}
2020-05-13 17:33:38.234 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=15, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER15", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=194}
2020-05-13 17:33:38.238 Error: dzVents: Error: (3.0.3) Discarding device. No last update info found: {["lastLevel"]=255, ["switchTypeValue"]=0, ["baseType"]="device", ["timedOut"]=false, ["description"]="", ["data"]={["unit"]=16, ["icon"]="lightbulb", ["_state"]="Off", ["hardwareID"]=2378232, ["_nValue"]=0, ["maxDimLevel"]=100, ["levelVal"]=0, ["hardwareTypeValue"]=94, ["usedByCamera"]=false, ["protected"]=false, ["hardwareName"]="tasmota more power", ["hardwareType"]="Autodiscovery of Tasmota Devices"}, ["rawData"]={"Off"}, ["changed"]=true, ["deviceType"]="Light/Switch", ["batteryLevel"]=1957746456, ["name"]="tasmota_156 POWER16", ["subType"]="Switch", ["lastUpdate"]="", ["deviceID"]="", ["signalLevel"]=11230008, ["protected"]=false, ["switchType"]="On/Off", ["id"]=195}

the only this is the error that appear only at first time discover, and no more. i try to restart domoticz, and it not appear again. if i delete the discovered devices, when they will be re-created by the script, the error come back, but only one time (so at first discovery) but do not create any kind of issue. i think that all is working.... :)

if you want, we can extend the auto recognize also for blinds control? what to you think? in domoticz are managed as dummy devices type "blind percentage inverted"

immagine immagine

joba-1 commented 4 years ago

ok, fine.

I don't understand why it only works the second time, but without related messages, I can't track this down.

FYI: The "strange names" follow these rules:

This currently does not fully work because the tasmota standard has changed, so my code thinks "TasmotaX" is user changed. I'll fix that soon and let you know.

Regarding blinds: we can try. Please open another issue for this with tasmota log of a blind from boot until first tele message (standard log level).

joba-1 commented 4 years ago

updated branch with friendly name fix. Please test. Would be nice if you could manually change the device name of the second and third switch in domoticz to see that they are really not overwritten later and then change some, but not all friendly names, e.g. the first, second, 5th and 8th in tasmota

megamarco833 commented 4 years ago

fantastic, i'll do immediatly. i also open the issue for blind, please let me know it you need more support thanks!

megamarco833 commented 4 years ago

updated branch with friendly name fix. Please test. Would be nice if you could manually change the device name of the second and third switch in domoticz to see that they are really not overwritten later and then change some, but not all friendly names, e.g. the first, second, 5th and 8th in tasmota

let me ask, but how do you like to proceed? i have to delete the devices in domoticz, then update the script, then restart domoticz? or you want that i left the device without deleting them and modify one name inside domoticz(eg the 3rd name), modify a second and 5th 8th friendly name in tasmota and then upload the script and restart domoticz? thanks

joba-1 commented 4 years ago

yes, I meant deleting devices in domoticz and let it rediscover

megamarco833 commented 4 years ago

ok, i did it. i deleted the dummy devices in domoticz then upload new phyton files then restart domoticz (it's needed???) then start the script:

 2020-05-13 21:07:55.759 Status: (tasmota more power) Stop directive received.
2020-05-13 21:07:55.759 Status: (tasmota more power) Exiting work loop.
2020-05-13 21:07:55.960 Status: (tasmota more power) Stopping threads.
2020-05-13 21:07:55.961 Status: (tasmota more power) Stopped.
2020-05-13 21:07:58.546 Status: (tasmota more power) Started.
2020-05-13 21:07:58.870 Status: (tasmota more power) Entering work loop.
2020-05-13 21:07:58.871 Status: (tasmota more power) Initialized version 1.3.1, author 'Joachim Banzhaf' 

immagine immagine it seams working. after that i change also a name inside domoticz and it still works: immagine

i think that's a very good result! do you have in mind other tests that i can support?

joba-1 commented 4 years ago

I agree. Good for a pull request. Thanks for the cooperation :)

megamarco833 commented 4 years ago

Eheheh thanks to you!!