The jaml I partly understand, but as a first day user this is a bit cryptic so I hope its ok to ask for a bit more…
Variable I receive from my Arduino to HA is a counter, it starts on 1, and for each time alarm is triggered it increases with one.
When water stops, HA receives a 0
What I don’t have pr now:
entity_id
device id → is that something like 5589b34c8686d3213?
How to I connect my jaml name “Dam”, unique_id: vannRenner and topic dam/vannRenner to the jaml code?
Pseudo code(?):
if vannRenner >0;
then sound an alarm on my phone (then I run )
This is what I understand:
automations:
- alias: "water is running"
trigger:
- platform: state
entity_id: sensor.pond_alarm
to: "water"
action:
- service: notify.mobile_app_<your_device_id_here>
data:
message: TTS
data:
ttl: 0
priority: high
media_stream: alarm_stream_max
tts_text: "The pond is starting to get empty!!!"
Based on the supplied configuration, the MQTT-based sensor’s entity ID should be sensor.dam. If you changed it to something else, make sure to adjust the automation accordingly.
You want to trigger an automation when the value of that sensor rises above 0. For that you use a Numeric State trigger.
# Example automations.yaml entry
- id: 'notify_pond_water_running_0001'
alias: Notify Pond Water Running
description: Send mobile TTS when pond water starts running
trigger:
- platform: numeric_state
entity_id: sensor.dam
above: 0
condition: []
action:
- service: notify.mobile_app_<your_device_id_here>
data:
message: TTS
data:
ttl: 0
priority: high
media_stream: alarm_stream_max
tts_text: "The pond is starting to get empty!!!"
EDIT: Modified for use directly in automations.yaml file.
As mentioned in the first sentence of the post, what I posted above is an automation. As such it needs to be added to the configuration wherever you have automations. This would normally be the automations.yaml file. I have updated the post above to use the configuration syntax needed for use in that file.
As a new user, unless you are already familiar with YAML, you would be better served setting it up in the Automation Editor. There are differences in the configuration syntax depending on the specific file you are adding it into.
If you need a primer on how to transcribe YAML automation configurations that you find here on the forums using the UI Automation Editor, there is a (slightly dated) tutorial available on the Resin Chem Tech Youtube channel.
Also, some of the indentation has been altered incorrectly and variable keys have been changed to invalid values (data changed to xdata).