#Complex automation, on event schedule event to start at another time

1 messages · Page 1 of 1 (latest)

wintry marsh
#

Ahoi

I've recently integrated a lot of my digital and physical estate into HA and had a great time.

I get emails occasionally telling me that I get free electricity. In these emails, there's a from time and a to time. The emails typically arrive up to 36 hours before the start of the free electricity event.

I can write a lil app to scrape my emails for one which tells me about such a session, and even likely extract the start and end time from it. The next problem is, though, I need to schedule my batteries and car to charge, as well as my hot tub to heat up at full chat.

Might be an awkward question, but is there a "right" way to do this? I'm thinking there might be some way to automate the creation of automations - I only need the actual controlling automation to run once per email (which I'd likely configure via webhook). I'm not entirely convinced that's the best way to go, though.

hasty spindle
#

Octopus?
You can do it with an imap sensor to scrape the date and start and end times into template sensors
Then trigger your automation at start time to start charging, end time to stop it

#

You can also schedule them into a calendar event, and that allows for overlapping events (when you get notified about one tomorrow before the one today runs) and then trigger off the calendar event for your automation

wintry marsh
#

Octopus indeed... This feels like such a janky thing to try to integrate. I don't really want to give HA access to my emails, so inclined to lean towards triggering any events via something I run and trust myself, but that side of things is mostly fine, I'm a software engineer, I know my way around APIs.

Scheduling calendar events may be a solution, I'll have a look into that... We already have a few shared calendars and there are some I could easily see myself getting up and running

hasty spindle
#

it's what i use, as i have a battery at my house i also empty that beforehand to get the maxumum free electricity

#

worrying about ha having access to your emails is wasted effort imo - it's open source, as is the imap sensor - so you can see it's not doing anything nefarious