59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
- alias: ' Coffee power plug disable at 6pm.'
|
|
description: ''
|
|
triggers:
|
|
- trigger: time
|
|
at: '18:00:00'
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
actions:
|
|
- type: turn_off
|
|
device_id: DEVICE_ID_HERE
|
|
entity_id: ENTITY_ID_HERE
|
|
domain: switch
|
|
mode: single
|
|
|
|
- alias: Uusi automaatio
|
|
description: ''
|
|
triggers:
|
|
- trigger: numeric_state
|
|
entity_id:
|
|
- sensor.dht11_humiditysensor
|
|
above: 33
|
|
conditions: []
|
|
actions:
|
|
- type: turn_on
|
|
device_id: DEVICE_ID_HERE
|
|
entity_id: ENTITY_ID_HERE
|
|
domain: switch
|
|
mode: single
|
|
|
|
- alias: mqtt-pub-coffee-maker-switch
|
|
description: ''
|
|
triggers:
|
|
- entity_id:
|
|
- switch.SWITCH_NAME
|
|
- sensor.SENSOR_NAME
|
|
- sensor.SENSOR_NAME
|
|
- sensor.SENSOR_NAME
|
|
trigger: state
|
|
actions:
|
|
- data:
|
|
topic: test/topic
|
|
payload: "{\n \"switch_state\": \"{{ states('switch.SENSOR_NAME') | default('unavailable')\
|
|
\ }}\",\n \"name\": \"coffee-maker-switch\",\n \"entity_name\": \"switch.SENSOR_NAME\"\
|
|
,\n \"current\": {\n \"value\": \"{{ states('sensor.SENSOR_NAME_current')\
|
|
\ | default('unavailalbe') }}\",\n \"unit\": \"Ampere\"\n },\n \"power\"\
|
|
: {\n \"value\": \"{{ states('sensor.SENSOR_NAME_power') | default('unavailable')\
|
|
\ }}\",\n \"unit\": \"Wattage\"\n },\n \"voltage\": {\n \"value\"\
|
|
: \"{{ states('sensor.SENSOR_NAME_voltage') | default('unavailable') }}\"\
|
|
,\n \"unit\": \"Volts\"\n },\n \"device_available\": \"{{ 'false' if\
|
|
\ states('switch.SENSOR_NAME_1') == 'unavailable' or states('switch.SENSOR_NAME')\
|
|
\ is none else 'true' }}\"\n}"
|
|
action: mqtt.publish
|