mampfes / ha_epex_spot

Adds EPEX Spot data to Home Assistant.
MIT License
143 stars 21 forks source link

Error in service example? #51

Closed gigatexel closed 11 months ago

gigatexel commented 1 year ago

Could it be that there is an error in the new example for calling the service? VS signals an error and the template renders Unknown

image

mampfes commented 1 year ago

Which home assistant version are you using?

nin9s commented 1 year ago

Having the same issue and using the latest version available

Also it doesn't work adding the sensor via gui as HA complains about the var "res" not being defined (for whatever cause as it actually should be defined in the action cause above 🤷‍♂️)

mampfes commented 1 year ago

It works on my machine if I put it into a yaml file (I didn't check the GUI). Maybe the VS syntax highlighter doesn't support this quite new feature yet. Regarding the unknown state: In your example, the state will be only updated once per day, at 00:00.

nin9s commented 1 year ago

solved for me, can’t say for sure what (I have) changed

mampfes commented 1 year ago

@nin9s Please share your configuration.

nin9s commented 1 year ago

put in configuration.yaml

template:
  - trigger:
      - platform: time
        at: 15:02
    action:
      - service: epex_spot.get_lowest_price_interval
        data:
          earliest_start: "09:00:00"
          latest_end: "18:00:00"
          duration:
            hours: 1
        response_variable: resp
    sensor:
      - name: epex_lowest_intervall
        device_class: timestamp
        state: "{{ resp.start is defined and resp.start }}"
mr-p666 commented 1 year ago

Again... I'm just a n00b at HASS. But don't you always need quotation marks around the time so that the colon is not misinterpreted? at: "15:02:00"

mampfes commented 11 months ago

Any updates?

nin9s commented 11 months ago

Fixed for me