I have a contract with my energy provider that distinguishes between a costly peak tariff and a more cost efficient off-peak tariff. However, there are is no fixed schedule when one tariff starts and the other one ends. The starting times significantly differ over the year, e.g. depending on the weather or the time of year.
The electricity meter receives signals from my energy provider and dynamically switches between peak and off-peak tariff. The electricity meter has an interface for iobroker which then sends the meter readings as MQTT messages to Home Assistant.
This is working absolutely fine, so that I have an idea how much energy has been consumed over the day and in which tariff by displaying a curve on the HA dashboard.
However, I have no idea how to control energy consumption based on the current tariff. For instance I would like to start major energy consumers when the off-peak tariff starts, stopping them when it ends.
I wonder if there’s a way in HA to realize such a “Peak/Off-Peak Energy Tariff Sensor”. This sensor would have to react on MQTT messages: in case of peak tariff there are only MQTT messages with topic “iobroker/smartmeter/0/1-0:1 8 1”, in case of off-peak tariff the topic changes to “iobroker/smartmeter/0/1-0:1 8 2”.
Is it possible to configure a sensor that toggles between peak and off-peak tariff depending on the topic of received MQTT messages?
Thanks a lot in advance for any help!