Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- binary_sensor:
- - platform: mqtt
- name: "My Computer - Connected"
- state_topic: "iotlink/workgroup/thanga-pc/lwt"
- value_template: "{{ value }}"
- payload_on: "ON"
- payload_off: "OFF"
- device_class: "connectivity"
- qos: 1
- switch 4:
- - platform: template
- switches:
- my_computer:
- friendly_name: "My Computer"
- value_template: "{{ is_state('binary_sensor.my_computer_connected', 'on') }}"
- turn_on:
- service: script.my_computer_wake
- turn_off:
- service: script.my_computer_suspend
- icon_template: mdi:laptop
- script:
- my_computer_wake:
- alias: "My Computer - Wake"
- sequence:
- - service: wake_on_lan.send_magic_packet
- data:
- mac: "00:00:00:00:00:00"
- my_computer_shutdown:
- alias: "My Computer - Shutdown"
- sequence:
- - service: mqtt.publish
- data:
- topic: "iotlink/workgroup/thanga-pc/commands/shutdown"
- payload: ""
- my_computer_suspend:
- alias: "My Computer - Suspend"
- sequence:
- - service: mqtt.publish
- data:
- topic: "iotlink/workgroup/thanga-pc/commands/suspend"
- payload: ""
- my_computer_vol_mute:
- alias: "My Computer - Toggle Mute"
- sequence:
- - service: mqtt.publish
- data:
- topic: "iotlink/workgroup/thanga-pc/commands/volume/mute"
- payload: ""
- input_number:
- target_temp:
- name: Computer volume
- min: 1
- max: 100
- step: 1
- unit_of_measurement: step
- icon: mdi:volume-high
- automation:
- - alias: Temp slider moved
- trigger:
- platform: state
- entity_id: input_number.target_temp
- action:
- service: mqtt.publish
- data_template:
- topic: 'iotlink/workgroup/thanga-pc/commands/volume/set'
- payload: "{{ states('input_number.target_temp') | int }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement