mampfes / ha_epex_spot_sensor

Provides helper sensors for EPEX Spot integration.
MIT License
48 stars 4 forks source link

Feature Request: Flexible duration from helper #10

Closed PetziAt closed 5 months ago

PetziAt commented 5 months ago

I like to request an alternate duration input based on an selectable (input_datetime) helper. This makes possible to include the duration offered from an device.

mampfes commented 5 months ago

This is a valid request. I need to check how much effort it is.

Adminius commented 5 months ago

It would be enough to provide an entity for duration. Best solution is template :)

grol-hass commented 5 months ago

I have implemented that in my fork just after the initial revision of this sensor came out: https://github.com/grol-hass/ha_epex_spot_sensor_variable_duration Feel free to pull changes from there.

I'm using it to determine when to charge my home battery from grid, that's why I also added code to make sure intermittent time slots are adjacent if possible. Also note that I have just replaced the timedelta from the configuration page completely by a input_number entity field (needs to be in seconds) - but I guess that could be modified to use an option to choose between a hardcoded value or an entity (maybe also a template sensor)

mampfes commented 5 months ago

@grol-hass Thanks for sharing. I will use this a template.