What i whant is read the events in calendar and when the title is
something, for thi example ‘Test Calendario HA’, make an action,
I have Google Calendar installed and seem to work because the entity is active
and oneother card connected works, nut the automation never trigger the calendar event.
here the code
# Azione su Evento in Calendario Google
- alias: 'Pulizia Strada'
trigger:
platform: state
entity_id: calendar.xxxxxxxxxxx_gmail_com
to: 'on'
condition:
condition: template
value_template: "{{is_state_attr('calendar.xxxxxxxxxxx_gmail_com', 'message', 'Test Calendario HA') }}"
action:
- service: script.applique_on
I tried also without condiction
# Azione su Evento in Calendario Google
- alias: 'Pulizia Strada'
trigger:
platform: state
entity_id: calendar.xxxxxxxxxxx_gmail_com
to: 'on'
action:
- service: script.applique_on
At the time the event occurs, do you see “calendar.xxxx_gmail.com” changing state from “off” to “on”?
You can check on the sidebar -> Developer Tools -> States
Then your automation can not work. The automation triggers when the calendar changes from “off” to “on”, if it is “on” all the time it will not trigger the automation.
Yes there is, you can create a sensor for a specific event.
Can you please post your google calendar configuration? Then I should be able to help you set this up.
I mean the configuration for the calendar, probably in a file called “google_calendars.yaml” and looks something like this:
- cal_id: "*****@group.calendar.google.com"
entities:
- device_id: test_everything
name: Give me everything
track: true
I don’t understand this, what script are you talking about? The link you posted describes everything needed to setup google calendars and make automations with the events.
I assume that the second entry is the calendar which contains the event “Test Calendario HA”?
Add another section like this:
- cal_id: *********@gmail.com
entities:
- device_id: test_calendario_ha
name: Test Calendario HA
track: true
search: "Test Calendario HA" # <-name of the event you want to track
This should create a sensor “sensor.test_calendario_ha” and this sensor will only change to “on” if the event has the name “Test Calendario HA”. You can then use this sensor as a trigger for your automation.
Can you show the full config you have now for the calendar?
I think the calendar is only updating every 15 minutes, did you wait at least 15 minutes before you checked?
Maybe you need to add a # before the search term for it to work, I can’t verify as I don’t use google calendar myself. Like this:
- cal_id: *********@gmail.com
entities:
- device_id: test_calendario_ha
name: Test Calendario HA
track: true
search: "#Test Calendario HA" # <-name of the event you want to track
We are getting closer You have now a sensor called “sensor.pulizia_strada” right?
And the event in your calendar is named “Domani Pulizia Strada” and at the time the event starts, the calendar stays off?
Can you try putting a # before “Domani Pulizia Strada”?
Yes with and without # but the problem i think is the pulizia_strada is disabled and i don’t know why!!
entity global_italia_giulio disabled
entity *********@gmail.com enabled and works
entity pulizia_strada disabled and doesn’t work
entity ddressbook#[email protected] disable
I don’t know why some calendar are disabled, until they are in this state i don’t think they can work
where i can enable them?
What do you mean with “they are disabled until they are in this state”, do you mean the state is “off” until the event starts and then turns to “on”, or is it “off” all the time?