slesinger / HomeAssistant-PREdistribuce

Home Assistant integration to display info about energy plan
https://slesinger.info
Apache License 2.0
11 stars 8 forks source link

Additional sensors not added #16

Open Kratax opened 8 months ago

Kratax commented 8 months ago

Hi, Thanks a lot for the add on. I tried to configure the other sensors as per below but still in the HA, there is only one sensor showing on off depending on the rate... Any advice what to correct? thanks a lot.

eMeF1 commented 7 months ago

@Kratax here is how I got it work. But frankly I am not a programmer and this is what ChatGPT suggested so hard to say how clean this solution is.

binary_sensor.py

raplece self._attr_unique_id = f"{DOMAIN}-hdo-{conf_cmd}" with self._attr_unique_id = f"{DOMAIN}-hdo-{conf_cmd}-{minutes}"

configuration.yaml

binary_sensor:
  - platform: predistribuce
    receiver_command_id: 565
    sensor_name: "PRE HDO"
    periods:
      - name: "HDO shower"
        minutes: 10
      - name: "HDO living room heating"
        minutes: 120

sensor:
  - platform: predistribuce
    receiver_command_id: 565

I would like to have also "HDO čas do vysokého tarifu" apart from "HDO čas do nízkého tarifu" but I couldn't make GPT to make it work.