Closed tomerbs closed 4 years ago
Your code is missing the attributes:
array.
Invoking the set_state_attributes
action requires to provide both state
and attributes
.
So your code should be:
'1596141541557':
alias: '###New Script Off'
sequence:
- data:
action: set_state_attributes
entity_id: binary_sensor.neo_coolcam_door_sensor
state: 'off'
attributes:
- attribute1: 'attribute value'
- attribute2: 'attribute value'
service: python_script.hass_entities
Check here for details: https://github.com/pmazz/ps_hassio_entities#set-both-state-and-attributes
Or, in case you need to set the state only, your should use action: set_state
.
Then your code should be:
'1596141541557':
alias: '###New Script Off'
sequence:
- data:
action: set_state
entity_id: binary_sensor.neo_coolcam_door_sensor
state: 'off'
service: python_script.hass_entities
Check here for this case: https://github.com/pmazz/ps_hassio_entities#set-state-only
Let me know if that helps.
Thanks a lot, it's working now.😉
בתאריך יום ו׳, 31 ביולי 2020, 01:23, מאת Paolo Mazzini < notifications@github.com>:
Your code is missing the attributes: array. Invoking the set_state_attributes action requires to provide both state and attributes.
So your code should be:
'1596141541557': alias: '###New Script Off' sequence:
- data: action: set_state_attributes entity_id: binary_sensor.neo_coolcam_door_sensor state: 'off' attributes:
- attribute1: 'attribute value'
- attribute2: 'attribute value' service: python_script.hass_entities
Check here for details: https://github.com/pmazz/ps_hassio_entities#set-both-state-and-attributes
Or, in case you need to set the state only, your should use action: set_state. Then your code should be:
'1596141541557': alias: '###New Script Off' sequence:
- data: action: set_state entity_id: binary_sensor.neo_coolcam_door_sensor state: 'off' service: python_script.hass_entities
Check here for this case: https://github.com/pmazz/ps_hassio_entities#set-state-only
Let me know if that helps.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pmazz/ps_hassio_entities/issues/1#issuecomment-666742331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4BLR2TN4BYBRQN3POEY6DR6HXHNANCNFSM4POURLTA .
👌
What is your question Can you please share one example of using the script in an automation or script.
YAML configuration