Using Google Calendar data from HA in Reactor
-
Good morning all,
This weekend I've been playing around with Home Assistant as a replacement (long term) for my aging Vera platform. I'm pretty amazed how much more capability it has. On the other hand, the sheer amount of variables it pulls in from devices is massive.In any case, I have added Google Calendar into Home Assistant for things like Federal Holidays and my daughter's school calendar. It connected to them without issue, which I had been having problems with in Vera an GCal3.
I connected MSR to Home Assistant, so I can start using some of the systems I've integrated into Home Assistant in MSR, and continue migrating my luup Reactor rules over to MSR. Now I'm trying to create a rule based on if today is a Federal Holiday or not. Reactor sees the calendar just fine, however, for whatever reason, it's not pulling data for today, but the next event, which in this case is Columbus day, three weeks away. The attribute that is pulling this is x_haas_attr.message.
I tested with my daughter's school calendar, and it did have an entry for today, and none of the other values seemed to be different, such as a "true" or something to tell me there is an entry.
The only thing I've been able to come up with, is there is a start_time attribute, which shows the date as 2022-10-10 00:00:00
The only thing I can think of is there might be a way to compare the current system date to that date, but I can't seem to figure that out in MSR.
Has anybody done this? Any suggestions?
-
There’s a part dedicated to dates in the docs. I think the best approach is to parse the date from the attribute and compare day and month part to start/end. Everything is covered under expressions in the docs.
@therealdb said in Using Google Calendar data from HA in Reactor:
There’s a part dedicated to dates in the docs. I think the best approach is to parse the date from the attribute and compare day and month part to start/end. Everything is covered under expressions in the docs.
I figured the issue out. All the documentation in HA had been telling me to use haas_attr: offset_reached to cue to the calendar event, which seems to work in Home Assistant when creating automations, but not in MSR. What I found through a bit of trial and error is that what I'm actually looking for is haas.state (primary).
Once I figured that out, adding conditions based upon hass_attr: message, which is actually the calendar title.
-
T toggledbits locked this topic on