I’m in my first week of HA and I can’t work out how to turn my hive heating off when everyone leaves, including a couple of smartthings presence sensors.
I think I’ve got the trigger and condition covered, but I don’t know how to send the command ‘OFF’ in the action?
Can anyone help please.
- alias: 'Heating off everyone away'
trigger:
platform: state
entity_id: group.all_devices
state: 'not_home'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.dzmm_home
to: 'off'
- condition: state
entity_id: binary_sensor.guest_home
to: 'off'
action:
service: homeassistant.turn_off
entity_id: sensor.hive_heating_mode, sensor.hive_hot_water_mode
to: 'SCHEDULE'
Edit: Changed OFF to Schedule as that’s what I meant
I haven’t started automating things yet personally (I just use it so far for information and using the HA GUI to change it), but you need to be changing the state of the climate device, as @treno mentioned sensors just tell you the current state of things.
If you have a single zone installation then you would need to change the “operation_mode” of the “climate.hive_heating” (if you have more than one zone then the climate device’s id is set to the zone name)
so your action might need to be something like the follow:
Thanks. I’d just spotted operation_mode after re-reading your post with the code and spotting that the original post doesn’t have the latest files.
I’ve got it working for when someone comes home, but I’m getting an error for when everyone leaves. Code that’s working:
- alias: 'Heating on someone home'
trigger:
- platform: state
entity_id: group.all_devices
to: 'home'
- platform: state
entity_id: binary_sensor.dzmm_home, binary_sensor.guest_home
to: 'on'
action:
service: climate.set_operation_mode
entity_id: climate.hive_heating
data:
operation_mode: "SCHEDULE"
Code that’s throwing up an error:
- alias: 'Heating off everyone away'
trigger:
platform: state
entity_id: group.all_devices
to: 'not_home'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.dzmm_home
to: 'off'
- condition: state
entity_id: binary_sensor.guest_home
to: 'off'
action:
service: climate.set_operation_mode
entity_id: climate.hive_heating
data:
operation_mode: "OFF"
2017-09-15 07:57:32 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: extra keys not allowed @ data['condition'][0]['conditions'][0]['to']. Got None
not a valid value for dictionary value @ data['condition'][0]['conditions'][0]['condition']. Got None. (See /config/configuration.yaml, line 560). Please check the docs at https://home-assistant.io/components/automation/
Yes, the Hive Integration post has a pretty old version of the code on the first post and you have to scroll down to a July 25th post for the latest code.
We are working on trying to get this added to Home-Assistant so that we wont need to download the Hive code separately and copy to the custom component folders.
I doubt we will have it ready for the next version of HA, but hopefully we will be in a position to submit the request for the version after next
I am not sure, it is not looking too promising. From what I / we can tell, it looks like we would need to create a new custom GUI component, which for me at the moment I don’t understand how to do