I’m sorry for this very easy question, but I’m finding it very hard to research this topic and finding my way into the world of HA’s automation/YAML syntax
I want to check if my dishwasher is running and increment a counter. If it hits 10/50/x, I want to get a message on my phone via notify.
Now, I don’t understand how to create an automation around that trigger. When I go to automations and add “when template triggers”, I have to insert some YAML code which I couldn’t find examples for on the internet
Also, I have no clue what this code means and did not find any syntax explanation …
What you find on the internet is usually not relevant for you.
But the template returns true or false, if the tasmota energy sensor is above 3 (probably watt).
Post what you have instead and we can help you with your problem.
Now that I (probably) know when the Tasmota sensor is above 3 something, how do I setup a simple notification/automation? From there on, I might be able to find the rest of the way myself, but I don’t know how to get this started :-/
Was working on similar but wanted a bit more and this I tuned a bit yst.
It sort-off has a flow based on from>to state and tweaking needs to be done depending on the plug and machine but it works now (qed this week) Make your washing machine smarter with Home Assistant | Emanuele Papa
You can have one trigger per each interval you want or if you have a pattern you can create a template to calculate that.
And you can also add something to reset your counter…
Maybe if you explain what is the point of that message it would be easier to find a better automation.
Now it seems that the binary_sensor is not found. I create the yaml-automation like you said and HA shows When something changes from off to on for 15 seconds.
I reloaded all yaml config several times and will reboot HA/the Pi now, but I think something is wrong there
Are you creating the sensor based on that code on your original post?
What if you go Developer Tools, select the tab State and then search for binary_sensor. spulmaschine_is_running?
If the sensor is not existing, try to go to Developer Tools, select the tab Yaml and then reload Templates (or restart Home Assistant).
If the sensor is still not there, could you please take a look on your logs (Settings > System > Logs)?
I thougt that I had read in the documentation of HA’s YAML that that’s exactly what you have to do after defining template: !somefile.yaml?
Anyway, I changed it to template:
and now I receive the error message YAML file /config/configuration.yaml contains duplicate key "template". Check lines 15 and 17
So I commented the line template: !include templates.yaml as #template: !include templates.yaml
Now I get the error message Invalid config for [template]: [id] is an invalid option for [template]. Check: template->binary_sensor->0->id. (See /config/configuration.yaml, line 18)., so I omitted that id line in the code.
If you have something set into your templates.yaml file you will miss those sensors
You can instead add your new binary sensor inside the templates.yaml.
By the way, id is an invalid key, but unique_id is valid and using that will enable additional functionalities to your new entity.