nspanel
nspanel copied to clipboard
Timed command to set HMI_dimOpen not working
hi, please help, I'm struggling with a timer based setting. I want to send HMI_dimOpen 0 in the morning and 1 in the evening.
I changed nspanel.be as following:
def dimnight()
nsp.send('{"HMI_dimOpen": 1}')
print("DimNight called")
end
def dimday()
nsp.send('{"HMI_dimOpen": 0}')
print("DimDay called")
end
tasmota.add_rule("Time#Minute=360", dimday)
tasmota.add_rule("Time#Minute=1290", dimnight)
I can see the command being sent in the console, but nothing else happened. For debugging purposes I chaned it to call DimNight every minute, here is the console:
20:40:00.846 NSP: Sent = {"year":2022,"mon":4,"day":6,"hour":20,"min":40,"week":3}
20:40:00.936 NSP: Sent = {"HMI_dimOpen": 1}
20:40:00.959 DimNight called
20:41:00.859 NSP: Sent = {"year":2022,"mon":4,"day":6,"hour":20,"min":41,"week":3}
But nothing changes, display stays on.
Sending that payload via NSPSend via console, it works.
What's what I am doing wrong?
try calling with tasmota.add_rule("Time#Minute=360", /-> dimday())
that made it worse, device didn't connect to MQTT server anymore and nothing happened.
I think I found then problem: there's a space in the json Infront of the 0 and 1 - even tough its valid json, the Panel doesnt seem to like it.
Now I'm struggling with the time - is the #minute=xxx local time or from gmt?