V
Size: a a a
V
AS
V
SF
V
SF
V
V
SF
V
V
SF
AS
V
SF
ДЦ
ДЦ
GS
value_template:
для переключателя, ведь его статус не зависит от внешних факторов а только от самого себя. Подскажите плиз, кто знает?script:
street_gate_rf_send:
alias: 'Send RF command for open street gate'
sequence:
- service: mqtt.publish
data:
topic: "gateway/OpenMQTTGateway_RF-IR-BLE/commands/MQTTto433"
payload: '{ "value":2917, "protocol":8, "length":12, "delay":413 }'
binary_sensor:
- platform: mqtt
name: "RF gateway"
state_topic: "gateway/OpenMQTTGateway_RF-IR-BLE/LWT"
payload_on: "online"
payload_off: "offline"
switch:
- platform: template
switches:
street_gate:
turn_on:
service: script.street_gate_rf_send
turn_off:
icon_template: >-
{% if is_state('switch.street_gate', 'on') %}
mdi:boom-gate-up
{% else %}
mdi:boom-gate
{% endif %}
availability_template: "{{ is_state('binary_sensor.rf_gateway', 'on') }}"
automation:
- id: 'street_gate_auto_off'
alias: Auto Close Street Gate
trigger:
platform: state
entity_id:
- switch.street_gate
to: 'on'
for:
seconds: 15
action:
- service: switch.turn_off
entity_id: switch.street_gate
GS
ДЦ