home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.73k forks source link

Period is not a valid Attribute when changing System Mode #86344

Closed siw1973 closed 1 year ago

siw1973 commented 1 year ago

The problem

I have set up a number of Automations to allow a user to change the System Mode with Boolean Triggers.

When using Auto no Period / Duration is required, for AutoWithEco with / without Duration works, for all other values as per the documentation with / without Period should be acceptable.

However when adding in a Period in the other Modes this is rejected and an error logged.

What version of Home Assistant Core has the issue?

Home Assistant 2023.1.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Honeywell Total Connect Comfort (Europe)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/evohome/

Diagnostics information

No response

Example YAML snippet

alias: "Automation : Heating : Heating - Off"
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.heating_off
    to: "on"
  - platform: template
    value_template: >-
      {{ state_attr('climate.xxxxxxxxxxxxxxx',
      'status').system_mode_status.mode == 'HeatingOff' }}
condition: []
action:
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id:
        - input_boolean.heating_off
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id:
        - input_boolean.heating_away
        - input_boolean.heating_wfh
        - input_boolean.heating_normal
        - input_boolean.heating_eco
  - if:
      - condition: template
        value_template: >-
          {{ state_attr('climate.xxxxxxxxxxxxxxx',
          'status').system_mode_status.mode != 'HeatingOff' }}
    then:
      - service: evohome.set_system_mode
        data:
          mode: HeatingOff
          period: 1
mode: single

===========================================================================

alias: "Automation : Heating : Heating - Away"
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.heating_away
    to: "on"
  - platform: template
    value_template: >-
      {{ state_attr('climate.xxxxxxxxxxxxxxx',
      'status').system_mode_status.mode == 'Away' }}
condition: []
action:
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id:
        - input_boolean.heating_away
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id:
        - input_boolean.heating_off
        - input_boolean.heating_wfh
        - input_boolean.heating_normal
        - input_boolean.heating_eco
  - if:
      - condition: template
        value_template: >-
          {{ state_attr('climate.xxxxxxxxxxxxxxx',
          'status').system_mode_status.mode != 'Away' }}
    then:
      - service: evohome.set_system_mode
        data:
          mode: Away
          period: 1
mode: single

Anything in the logs that might be useful for us?

**ERROR FOR Away**

Logger: homeassistant.components.automation.automation_heating_heating_away
Source: helpers/script.py:409
Integration: Automation (documentation, issues)
First occurred: 1:57:08 PM (2 occurrences)
Last logged: 1:57:08 PM

Automation : Heating : Heating - Away: If at step 3: Error executing script. Invalid data for call_service at pos 1: value must be one of ['Auto', 'HeatingOff'] for dictionary value @ data['mode']
Automation : Heating : Heating - Away: Error executing script. Invalid data for if at pos 3: value must be one of ['Auto', 'HeatingOff'] for dictionary value @ data['mode']

Logger: homeassistant.components.automation.automation_heating_heating_away
Source: components/automation/__init__.py:567
Integration: Automation (documentation, issues)
First occurred: 1:57:08 PM (1 occurrences)
Last logged: 1:57:08 PM

Error while executing automation automation.automation_heating_heating_away: value must be one of ['Auto', 'HeatingOff'] for dictionary value @ data['mode']

**ERROR FOR HeatingOff**

Logger: homeassistant.components.automation.automation_heating_heating_off
Source: helpers/script.py:409
Integration: Automation (documentation, issues)
First occurred: 1:59:25 PM (8 occurrences)
Last logged: 2:04:17 PM

Automation : Heating : Heating - Off: If at step 3: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['duration']
Automation : Heating : Heating - Off: Error executing script. Invalid data for if at pos 3: extra keys not allowed @ data['duration']
Automation : Heating : Heating - Off: If at step 3: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['period']
Automation : Heating : Heating - Off: Error executing script. Invalid data for if at pos 3: extra keys not allowed @ data['period']

Logger: homeassistant.components.automation.automation_heating_heating_off
Source: components/automation/__init__.py:567
Integration: Automation (documentation, issues)
First occurred: 1:59:25 PM (4 occurrences)
Last logged: 2:04:17 PM

Error while executing automation automation.automation_heating_heating_off: extra keys not allowed @ data['duration']
Error while executing automation automation.automation_heating_heating_off: extra keys not allowed @ data['period']

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @zxdavb, mind taking a look at this issue as it has been labeled with an integration (evohome) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `evohome` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign evohome` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


evohome documentation evohome source (message by IssueLinks)

siw1973 commented 1 year ago

Any chance someone could comment on this ?

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.