Template binary sensor based on switch not changing

I have create this template to reflect when the zwave switch detects motion. But the template doesn’t seem to be working. I’m missing something?

``

  • platform: template
    sensors:
    achterdeur_bewegingssensor_sensor:
    entity_id: switch.achterdeur_verlichting_switch_3
    value_template: “{{ states.switch.achterdeur_verlichting_switch_3.state }}”
    friendly_name: ‘Achterdeur bewegingssensor’
    device_class: motion
    ``

What you have currently will just reflect the state of the switch, which should already be available.

Is this a switch with motion detection? Does the switch pass an attribute for the motion sensor? Posting a screen shot of your states tab for this switch may help.

This is the log:

2017-07-13 20:50:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]:  entity_id=switch.achterdeur_verlichting_switch_3, old_state=<state switch.achterdeur_verlichting_switch_3=on; node_id=5, value_index=0, value_instance=3, old_entity_id=switch.achterdeur_verlichting_switch_5_0_3, new_entity_id=switch.achterdeur_verlichting_switch, friendly_name=Achterdeur verlichting Switch, hidden=True @ 2017-07-13T20:48:51.181259+02:00>, new_state=<state switch.achterdeur_verlichting_switch_3=off; node_id=5, value_index=0, value_instance=3, old_entity_id=switch.achterdeur_verlichting_switch_5_0_3, new_entity_id=switch.achterdeur_verlichting_switch, friendly_name=Achterdeur verlichting Switch, hidden=True @ 2017-07-13T20:50:19.329565+02:00>>

This is a Zwave switch with 1 physical switch that has motion sensor on it. but the switch entity changes how it should work. But the Zwave switch doesn’t enable the device that is attach to it. This is how it function.

I would the binary switch for motion detection to have a nicer look on my states tab.

Hopefully it’s a bit clearer.

Can you open the left side bar then click the <> button. Find your switch and paste the info.

The left column is the entity ID, the middle is the current state and the right has all the attributes, If I understand your question correctly I think you want to pull a switch attribute.

@silvrr here is the information:

switch.achterdeur_verlichting_switch_3
off
node_id: 5
value_index: 0
value_instance: 3
old_entity_id: switch.achterdeur_verlichting_switch_5_0_3
new_entity_id: switch.achterdeur_verlichting_switch
friendly_name: Achterdeur verlichting Switch
hidden: true

Bump in the hope some one know how to fix this.

I do not really understand what you mean, what your problem is and what you want to achieve. Could you please rephrase it in an otherway so that I can help you a bit more ?
If the problem is simply have a nicer look, the customize component may be enough to solve the problem I think, no ?

Can be closed, Some how after upgrading to the latest version the binary sensor template now works

1 Like