Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timed command to set HMI_dimOpen not working #35

Open
CybDis opened this issue Apr 6, 2022 · 2 comments
Open

Timed command to set HMI_dimOpen not working #35

CybDis opened this issue Apr 6, 2022 · 2 comments

Comments

@CybDis
Copy link

CybDis commented Apr 6, 2022

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?

@blakadder
Copy link
Owner

try calling with tasmota.add_rule("Time#Minute=360", /-> dimday())

@CybDis
Copy link
Author

CybDis commented Apr 9, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants