I’m not a developer but having fun with learning HA and the great integrations I’ve added. One of them seems simple and I don’t know where to start and would appreciate some help?
I added the Jewish calendar to my config and see many sensor entities. How can I announce a sensor state with the play media action?
sensor.jewish_calendar_parshat_hashavua
Specifically for example I want to announce this sensor every Friday at 10am, what would I need to write and where?
Create an automation with a Time Trigger set to 10:00. Add a Time Condition that restricts it to Fridays. In the automation’s action you will add a service call to … well, this part is unclear because I would need to know what the sensor’s value contains and how you want to render it on whatever media_player you have. Do you want the media_player to say the value?
OK, if can already do all of that then the part you want is where it combines some phrase like “Good morning the value is” with the current value of the sensor.
To do that you will need to use a template like this:
Good morning the value is {{ states('sensor.jewish_calendar_parshat_hashavua') }}
Everything between the paired set of double-braces will be replaced by the sensor’s current state value.
Ok so I create that template and name it template1 then what? Actually I see scripts where and how do I create a template? I just ran the template editor and see the response value using your syntax
I selected template as an action in an automation and added your syntax and when choose test it returns an error? I’m guessing I’m still missing some steps.
Your automation’s action should contain a service call to a Text-to-Speech service. For example:
action:
- service: tts.google_translate_say
data:
entity_id: media_player.your_player
message: "Good morning the value is {{ states('sensor.jewish_calendar_parshat_hashavua')"
service: tts.google_translate_say
target:
entity_id: media_player.entryway_wifi
data:
message: "Good morning the value is {{ states('sensor.jewish_calendar_parshat_hashavua') }}"
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.