Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

lukich48/hass_mqtt_template_switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mqtt template switch

Based on standard mqtt switch component with templateble properties:

payload_on
payload_off

Each of them can contains template

Example:

switch:
  - platform: mqtt_template
    name: laundry-fan
    state_topic: "home/bathroom/switch/laundry-fan/state"
    command_topic: "home/bathroom/switch/laundry-fan"
    payload_on: '{"action":"hold","duration": {{(states.input_number.fan_duration.state
        | int)*1000}}}'
    payload_off: '{"action":"off"}'
    state_on: 1
    state_off: 0

About

mqtt template switch for homeassistant

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages