snaptec / openWB

openWB - die modulare Wallbox
https://openwb.de
GNU General Public License v3.0
341 stars 205 forks source link

smarthome Tasmota: changed json reporting since version 14.x #2839

Open hawa-lc4 opened 1 month ago

hawa-lc4 commented 1 month ago

Since Tasmota version 14.x the json reporting is changed and it seems to be the case this beeing the new standard there. The documentation regarding this however seems to be weak. For smarthome devices based on Tasmota the actual power and power state is requested in "watt.py" by using the response of the Status command. The response for "Status" changed regarding the power state from an integer value (e.g. ...,"Power":3,.....) representing the power state of all configured relais to a string value showing each relais in a bitwise state (e.g. ...,"Power":"011",.....). As a result the script "watt.py" is no longer able to determine the power state correctly.

My working solution is as attached file watt.py and has an addition to report also the consumed energy. This works for Tasmota version 12.x/13.x and 14.x as well, assuming the primary relais controlled by openWB is always the first (or only) relais and is reported as "POWER" or "POWER1" by "Status 11" command. watt.py.txt

benderl commented 1 month ago

When you already have a solution, please open a pull request.