I have set up mqtt to an arduino, works great. Now I would like to turn off the switch after x amounts of minutes. I am testing first with a constant amount of seconds but it ain’t happening…
Also, when I try to make the time a slider, my config won’t compile. Anyone?
Could the issue be that you want switch.back_sprinkler, not switch.back_sprinker?
I’m pretty sure that you can’t use templates as a value for for: at this time. You can probably get around this by creating a template sensor that compares the timestamp to your slider value. Then trigger your automation from that sensor.
Take a look at the alarm clock thread if you need some examples of time calculations with sliders.
Hey I recently installed home assistant, where do I put the code? I tried pasting the code in configuration.yaml, automations.yaml and script.yaml but I’m getting this error message:
General Errors:
- Setup failed for script: Invalid config.
Successful config (partial)
script:
I would appreciate any help, this looks kinda confusing.
You can either put it all in configuration.yaml (which is basically what the example above is doing), or split it up.
The reason for splitting it up is that configuration.yaml would become very big very quickly, so it makes sense to have a separate file (or files) for automations, another one for scripts etc.
Given that you have a separate automations.yaml file it looks like you’re set up that way.
Basically what happens is that in configuration.yaml you create an automations setting that refers to the file where the automations are kept. Same for scripts etcetera.
So if you do that, then you need to split the code mentioned above over those various files. The automations part goes in the automations file, etcetera.