I have defined an input_boolean which is turned on/off by an automation.
alias: Occupancy - Office Turn On
trigger:
platform: state
entity_id: sensor.office_pir
from: 'standby'
to: 'motion detected'
action:
service: input_boolean.turn_on
entity_id: input_boolean.office_occupancy
alias: Occupancy - Office Turn Off After 30min
trigger:
platform: state
entity_id: sensor.office_pir
to: 'standby'
for:
minutes: 30
action:
service: input_boolean.turn_off
entity_id: input_boolean.office_occupancy
I donât like the look of the switch in the dashboard and wanted to know if I can change to a binary_sensor since the states are just on/off. I like that there is visual feedback when a binary sensor is on or off.
Iâve tried the template binary sensor examples and I canât seem to get it to work, wondering if itâs possible.
2017-06-26 15:46:27 ERROR (MainThread) [homeassistant.config] Invalid config for [binary_sensor.template]: [vvalue_template] is an invalid option for [binary_sensor.template]. Check: binary_sensor.template->sensors->office_occupancy_on->vvalue_template. (See ?, line ?). Please check the docs at https://home-assistant.io/components/binary_sensor.template/
I wasnât complaining I was simply telling @rpitera that his answer wasnât working. But @pplucky you are correct, I had an extra character in the value_template, thanks for catching that.
After correcting I no longer get errors but the binary sensor is in an âoffâ state while the input_boolean is in an âonâ state.
Edit:
I did a little more playing around and found the following code to work
I use the following template for my Presence Input_boolean to convert from an On/Off switch to Home/Away which works fine but Iâm hoping to add to it. Is there a way for the template to pull in Zone Information ie: My wife is away but inside another zone, example the kids school?