Ok I did not think about a virtual switch.
Using your code the automation works but not all the time.
See logs below but when it does no work I cant see any state change for the binary sensor.
Try quick and long push, does not solve the issue.
Not working:
2018-07-09 11:26:37 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state zigate.e7d9=2018-07-09 11:26:35; max_tx=100, friendly_name=44a9, missing=False, max_rx=100, manufacturer=1037, power_type=0, battery=2.995, type=lumi.sensor_86sw2, ieee=00158d0001f480c8, descriptor_capability=00000000, addr=44a9, bit_field=0100000000000010, max_buffer=127, icon=mdi:access-point, receiver_on_when_idle=False, battery_level=35, server_mask=0, last_seen=2018-07-09 11:26:35, mac_capability=10000000, rssi=159, rssi_percent=62, id=0 @ 2018-07-09T13:26:35.406126+02:00>, entity_id=zigate.e7d9, new_state=<state zigate.e7d9=2018-07-09 11:26:37; max_tx=100, friendly_name=44a9, missing=False, max_rx=100, manufacturer=1037, power_type=0, battery=2.995, type=lumi.sensor_86sw2, ieee=00158d0001f480c8, descriptor_capability=00000000, addr=44a9, bit_field=0100000000000010, max_buffer=127, icon=mdi:access-point, receiver_on_when_idle=False, battery_level=35, server_mask=0, last_seen=2018-07-09 11:26:37, mac_capability=10000000, rssi=159, rssi_percent=62, id=0 @ 2018-07-09T13:26:37.678747+02:00>>
working:
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state binary_sensor.zigate_44a9_onoff=off; addr=44a9, attribute=0, friendly_name=zigate_44a9_onoff, endpoint=1, cluster=6 @ 2018-07-09T13:26:29.716390+02:00>, entity_id=binary_sensor.zigate_44a9_onoff, new_state=<state binary_sensor.zigate_44a9_onoff=on; addr=44a9, attribute=0, friendly_name=zigate_44a9_onoff, endpoint=1, cluster=6 @ 2018-07-09T13:27:29.049220+02:00>>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state zigate.e7d9=2018-07-09 11:26:37; max_tx=100, friendly_name=44a9, missing=False, max_rx=100, manufacturer=1037, power_type=0, battery=2.995, type=lumi.sensor_86sw2, ieee=00158d0001f480c8, descriptor_capability=00000000, addr=44a9, bit_field=0100000000000010, max_buffer=127, icon=mdi:access-point, receiver_on_when_idle=False, battery_level=35, server_mask=0, last_seen=2018-07-09 11:26:37, mac_capability=10000000, rssi=159, rssi_percent=62, id=0 @ 2018-07-09T13:26:37.678747+02:00>, entity_id=zigate.e7d9, new_state=<state zigate.e7d9=2018-07-09 11:27:29; max_tx=100, friendly_name=44a9, missing=False, max_rx=100, manufacturer=1037, power_type=0, battery=2.995, type=lumi.sensor_86sw2, ieee=00158d0001f480c8, descriptor_capability=00000000, addr=44a9, bit_field=0100000000000010, max_buffer=127, icon=mdi:access-point, receiver_on_when_idle=False, battery_level=35, server_mask=0, last_seen=2018-07-09 11:27:29, mac_capability=10000000, rssi=198, rssi_percent=78, id=0 @ 2018-07-09T13:27:29.061787+02:00>>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state binary_sensor.zigate_44a9_onoff=on; addr=44a9, attribute=0, friendly_name=zigate_44a9_onoff, endpoint=1, cluster=6 @ 2018-07-09T13:27:29.049220+02:00>, entity_id=binary_sensor.zigate_44a9_onoff, new_state=<state binary_sensor.zigate_44a9_onoff=off; addr=44a9, attribute=0, friendly_name=zigate_44a9_onoff, endpoint=1, cluster=6 @ 2018-07-09T13:27:29.074181+02:00>>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.components.automation] Executing allumer gauche
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=allumer gauche, domain=automation, entity_id=automation.allumer_gauche, message=has been triggered>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.helpers.script] Script allumer gauche: Running script
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.helpers.script] Script allumer gauche: Executing step call service
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1975355152-296, domain=homeassistant, service=turn_on, service_data=entity_id=[‘light.tv’]>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1975355152-297, domain=light, service=turn_on, service_data=entity_id=[‘light.tv’]>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1975355152-297>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1975355152-296>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.helpers.script] Script allumer gauche: Executing step call service
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1975355152-298, domain=persistent_notification, service=create, service_data=message=TEST>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, entity_id=persistent_notification.notification, new_state=<state persistent_notification.notification=notifying; message=TEST @ 2018-07-09T13:27:29.138093+02:00>>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1975355152-298>
2018-07-09 11:27:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.allumer_gauche=on; friendly_name=allumer gauche, last_triggered=2018-07-09T13:26:29.821565+02:00 @ 2018-07-09T13:22:28.516309+02:00>, entity_id=automation.allumer_gauche, new_state=<state automation.allumer_gauche=on; friendly_name=allumer gauche, last_triggered=2018-07-09T13:27:29.149381+02:00 @ 2018-07-09T13:22:28.516309+02:00>>