Skip to content

Commit

Permalink
tasmota auf shelly
Browse files Browse the repository at this point in the history
  • Loading branch information
okaegi committed Feb 17, 2021
1 parent d725e31 commit 75d0d81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/smarthome/tasmota/watt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
uberschuss=int(sys.argv[3])
answer = json.loads(str(urllib.request.urlopen("http://"+str(ipadr)+"/cm?cmnd=Status%208", timeout=3).read().decode("utf-8")))
aktpower = int(answer['StatusSNS']['ENERGY']['Power'])
if ( int(answer['StatusSNS']['ENERGY']['Voltage']) > 50 ):
#if ( int(answer['StatusSNS']['ENERGY']['Voltage']) > 50 ):
if aktpower > 50:
relais=1
else:
relais=0
powerc = 0
answer = '{"power":' + str(aktpower) + ',"powerc":' + str(powerc) + ',"on":' + str(relais) + '} '
f1 = open('/var/www/html/openWB/ramdisk/smarthome_device_ret' + str(devicenumber), 'w')
json.dump(answer,f1)
f1.close()
f1.close()

0 comments on commit 75d0d81

Please sign in to comment.