dala318 / nordpool_planner

nordpool_planner custom component for Home Assistant
MIT License
18 stars 4 forks source link

error message when using "var_duration_entity_id" #11

Closed ronaldt80 closed 1 year ago

ronaldt80 commented 1 year ago

Hi, fantastic job on this integration. I am trying to convert it for use with Entso-e but a bit of a novice with python so for the time being very happy with your solution.

Quick question though, when I set up the binary sensor with a reference to "var_duration_entity_id" why HA throws up an nasty error:

Invalid config for [binary_sensor.nordpool_planner]: [var_duration_entity_id] is an invalid option for [binary_sensor.nordpool_planner]

I used the following configuration:

binary_sensor:
  - platform: nordpool_planner
    nordpool_entity: sensor.nordpool_kwh_nl_eur_3_10_009
    entity_id: "charge car when cheap"
    duration: 2
    var_duration_entity_id: sensor.charge_time_required
    accept_cost: 0.0
    accept_rate: 0.0
    static:
      end_hour: 7
      var_end_hour_entity: input_number.need_fully_charged_car_at
      split_hours: false

When is # the var duration it does work so clearly an issue there.

By way of background, the template sensor (charge_time_required) is an int, for some reason its state is 0.72 though (i would have expected 1).

Any thoughts what could be causing this?

tjsblu commented 1 year ago

Hi @ronaldt80, I observed the same. Just leave the "_id" out, i.e.

var_duration_entity: sensor.charge_time_required

There are some updating needs in the documentation.

ronaldt80 commented 1 year ago

Perfect!

ronaldt80 commented 1 year ago

Closed, will propose change to documentation