Am a very new user, so please forgive if this is a daft question!
I want to trigger a hue light based on whether a meeting room is …
Booked for a private meeting - hue light is red
Booked, but not for a private meeting - hue light is amber
Free - hue light is green
I have successfully created automatons that get some of the way there …
Room is booked (at all) - hue to red
Room is Free - hue to green
I need to add a condition that tests the calendar entry for containing the text “[PRIVATE]” for the red light of the word “[OPEN]” for the amber light …
This snippet works for an exact match of the word “purple” as the meeting topic, but how do I get to the contains words element of what i want?
I think it’s working As it happens, there are actually 4 states in total that I need to deal with.
No room booking => Green
Room booking with text “[OPEN]” => Amber
Room booking with text “[PRIVATE]” => Red
Room booking without ("[OPEN]" or “[PRIVATE”]) => Amber
I’ll fool around to see if I can get this to work. Where can I find documentation on how to construct these boolean-like operations? i.e. “in” and “.lower” etc …
I’ve also noticed that there seems to be several minutes of tolerance on the triggers … i.e. a room is booked from 15:00 will not trigger until several minutes later … do I have any control over this??
I guess I would like to flip the status 5 minutes before a meeting starts and 5 minutes after it ends. I have a feeling this will cause some other nastiness if meetings are adjacent!
Sorry to revive such an old thread but it contains a snippet of what I’m trying to do.
I’m very new to this coming from Webcore/Smartthings
I’m trying to figure out if this is right and also to add functionality to modify the message sent to Vicky depending on which property she has a clean for.
We check Vicky.calendar to see if there is a match for ‘cleaning’
We then need to check which property the clean is for, so I somehow need to add a if statement to modify the message_text XYZ…
If contains OhakuneLot1 then XYZ = 30 my street
if contains OhakuneLot2 then XYZ = 31 my street
if contains ChaletGryon then XYZ = 21 Jump street
We then notify the cleaner 2hrs before the clean as a reminder.
Trying to work out if this will work, without having to wait for the next event
alias: Notify Vicky of clean Today
description: ''
trigger:
- platform: calendar
event: start
offset: '-2:0:0'
entity_id: calendar.vicki_calendar
condition:
- condition: template
value_template: >-
{{ 'cleaning' in states.calendar.vicki_calendar.attributes.message.lower()
}}
action:
- if:
- condition: template
value_template: >-
{{ 'OhakuneLot1' in
states.calendar.vicki_calendar.attributes.message.lower() }}
then:
- service: rest_command.websms_txt
data:
message_to: 64271234567
message_text: >-
This is a friendly reminder that you have a clean at 30c xxx Dr
today
- if:
- condition: template
value_template: >-
{{ 'OhakuneLot2' in
states.calendar.vicki_calendar.attributes.message.lower() }}
then:
- service: rest_command.websms_txt
data:
message_to: 64271234567
message_text: >-
This is a friendly reminder that you have a clean at 30d xxx Dr
today
- if:
- condition: template
value_template: >-
{{ 'ChaletGryon' in
states.calendar.vicki_calendar.attributes.message.lower() }}
then:
- service: rest_command.websms_txt
data:
message_to: 64271234567
message_text: >-
This is a friendly reminder that you have a clean at 132c xxx st
today
- if:
- condition: template
value_template: >-
{{ 'OhakuneLot3' in
states.calendar.vicki_calendar.attributes.message.lower() }}
then:
- service: rest_command.websms_txt
data:
message_to: 64271234567
message_text: >-
This is a friendly reminder that you have a clean at 30e xxx Dr
today
mode: queued
So its working, however the problem I have is there is two entries for tomorrow at 11am and its sending the same message twice, rather than one for 30e and one for 132c xxx st
So I’m getting two messages to my mobile phone saying “clean at 30e xxx Dr”.
I’m assuming because only a single state can be read / reported at a time.
If I go to developer tools for the calendar, it shows the 30e entry but not the 132c entry even though both happen at the same time.