Sony TV replaces Viera, Veon Media Button Updates

This commit is contained in:
root
2022-12-09 15:04:07 +13:00
parent 5504b8c93e
commit adbbdf0b95
6 changed files with 256 additions and 47 deletions

View File

@@ -0,0 +1,14 @@
- id: '1669966515993'
alias: Turn off Lounge TV
description: ''
trigger:
- platform: mqtt
topic: viewroad-commands/maintv/action
payload: 'OFF'
condition: []
action:
- type: turn_off
device_id: 4a9f71fc64e158f1c9286d6e43ce782e
entity_id: remote.sony_kd_55x85k
domain: remote
mode: single

View File

@@ -113,13 +113,13 @@ sensor:
# Quality of Wifi in dBm # Quality of Wifi in dBm
- platform: wifi_signal - platform: wifi_signal
name: "WiFi Signal" name: "WiFi Signal"
update_interval: 20s update_interval: 10s
retain: true retain: true
# Analog sensor for voltage reading (A0) # Analog sensor for voltage reading (A0)
- platform: adc - platform: adc
pin: A0 pin: A0
name: "Battery Voltage" name: "Battery Voltage"
update_interval: 20s update_interval: 10s
retain: true retain: true
filters: filters:
- multiply: 18.52 # trial and error calc/measure - multiply: 18.52 # trial and error calc/measure

View File

@@ -19,3 +19,11 @@ mqtt:
state_topic: "tele/tasmo-wemosd1-7280-powermon-1/SENSOR" state_topic: "tele/tasmo-wemosd1-7280-powermon-1/SENSOR"
unit_of_measurement: "kW" unit_of_measurement: "kW"
value_template: "{{ value_json.ENERGY.Power[2] }}" value_template: "{{ value_json.ENERGY.Power[2] }}"
sensor:
- platform: template
sensors:
electricity_power_total:
friendly_name: "Electricity Power Total"
unit_of_measurement: "W"
value_template: "{{ states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_0') |float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_1') | float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_2') | float }}"

View File

@@ -1,10 +1,10 @@
mqtt: #mqtt:
sensor: # sensor:
- unique_id: office_media_button_1 # - unique_id: office_media_button_1
name: "Office Media Button" # name: "Office Media Button"
state_topic: "tele/tasmo-zigb-6440-1/9CB5/SENSOR" # state_topic: "tele/tasmo-zigb-6440-1/9CB5/SENSOR"
unit_of_measurement: "Press" # unit_of_measurement: "Press"
value_template: "{{ value_json.ZbReceived.Office_Media_Button.Power }}" # value_template: "{{ value_json.ZbReceived.Office_Media_Button.Power }}"
automation: automation:
- id: "1629271273952" - id: "1629271273952"
@@ -12,8 +12,8 @@ automation:
description: "" description: ""
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.office_media_button entity_id: sensor.media_button_office_zbt04_action
to: "1" to: "single"
condition: [] condition: []
action: action:
- service: media_player.media_pause - service: media_player.media_pause
@@ -25,38 +25,38 @@ automation:
description: "" description: ""
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.office_media_button entity_id: sensor.media_button_office_zbt04_action
to: "2" to: "double"
condition: [] condition: []
action: action:
- service: media_player.media_play - service: media_player.media_play
target: target:
device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa
mode: single mode: single
- id: "1629271273958" # - id: "1629271273958"
alias: Pause office TV on MQTT # alias: Pause office TV on MQTT
description: "" # description: ""
trigger: # trigger:
- platform: mqtt # - platform: mqtt
topic: viewroad-commands/officetv/action # topic: viewroad-commands/officetv/action
payload: pause # payload: pause
encoding: utf-8 # encoding: utf-8
condition: [] # condition: []
action: # action:
- service: media_player.media_pause # - service: media_player.media_pause
target: # target:
device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa # device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa
mode: single # mode: single
- id: "1630969028384" # - id: "1630969028384"
alias: Skip Forward 30 Seconds on Media Button # alias: Skip Forward 30 Seconds on Media Button
description: "" # description: ""
trigger: # trigger:
- platform: state # - platform: state
entity_id: sensor.office_media_button # entity_id: sensor.media_button_office_zbt04_action
to: "3" # to: "triple"
condition: [] # condition: []
action: # action:
- service: media_player.media_seek # - service: media_player.media_seek
data: # data:
seek_position: 30 # seek_position: 30
mode: single # mode: single

View File

@@ -0,0 +1,193 @@
mqtt:
sensor:
- state_topic: "viewroad-status/rpis/cctvquad1/cpu-temp"
name: "CCTVQuad1 CPU Temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
- state_topic: "viewroad-status/rpis/cctvquad1/cpu-use"
name: "CCTVQuad1 CPU Use"
unit_of_measurement: "%"
icon: mdi:cpu-32-bit
- state_topic: "viewroad-status/rpis/cctvquad1/ram-use"
name: "CCTVQuad1 RAM Use"
unit_of_measurement: "%"
icon: mdi:raspberry-pi
- state_topic: "viewroad-status/rpis/cctvquad1/disk-use"
name: "CCTVQuad1 Disk Use"
unit_of_measurement: "%"
icon: mdi:harddisk
- state_topic: "viewroad-status/rpis/cctvquad1/uptime"
name: "CCTVQuad1 Uptime"
icon: mdi:timer
- state_topic: "viewroad-status/rpis/cctvquad1/last-seen"
name: "CCTVQuad1 Last Seen"
icon: mdi:calendar-clock
- state_topic: "viewroad-status/rpis/cctvquad1/ipv4-address"
name: "CCTVQuad1 IPv4 Address"
icon: mdi:server-network
- state_topic: "viewroad-status/rpis/cctvquad2/cpu-temp"
name: "CCTVQuad2 CPU Temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
- state_topic: "viewroad-status/rpis/cctvquad2/cpu-use"
name: "CCTVQuad2 CPU Use"
unit_of_measurement: "%"
icon: mdi:cpu-32-bit
- state_topic: "viewroad-status/rpis/cctvquad2/ram-use"
name: "CCTVQuad2 RAM Use"
unit_of_measurement: "%"
icon: mdi:raspberry-pi
- state_topic: "viewroad-status/rpis/cctvquad2/disk-use"
name: "CCTVQuad2 Disk Use"
unit_of_measurement: "%"
icon: mdi:harddisk
- state_topic: "viewroad-status/rpis/cctvquad2/uptime"
name: "CCTVQuad2 Uptime"
icon: mdi:timer
- state_topic: "viewroad-status/rpis/cctvquad2/last-seen"
name: "CCTVQuad2 Last Seen"
icon: mdi:calendar-clock
- state_topic: "viewroad-status/rpis/cctvquad2/ipv4-address"
name: "CCTVQuad2 IPv4 Address"
icon: mdi:server-network
switch:
- name: "CCTVQuad1 Reboot"
state_topic: "viewroad-status/rpis/cctvquad1/reboot"
command_topic: "viewroad-commands/rpis/cctvquad1/reboot/set"
qos: 1
optimistic: false
retain: false
icon: mdi:refresh
- name: "CCTVQuad1 Shutdown"
state_topic: "viewroad-status/rpis/cctvquad1/shutdown"
command_topic: "viewroad-commands/rpis/cctvquad1/shutdown/set"
qos: 1
optimistic: false
retain: false
icon: mdi:close-network
- name: "CCTVQuad2 Reboot"
state_topic: "viewroad-status/rpis/cctvquad2/reboot"
command_topic: "viewroad-commands/rpis/cctvquad2/reboot/set"
qos: 1
optimistic: false
retain: false
icon: mdi:refresh
- name: "CCTVQuad2 Shutdown"
state_topic: "viewroad-status/rpis/cctvquad2/shutdown"
command_topic: "viewroad-commands/rpis/cctvquad2/shutdown/set"
qos: 1
optimistic: false
retain: false
icon: mdi:close-network
binary_sensor:
- platform: template
sensors:
pi_cctvquad1_on:
friendly_name: "CCTV Quad1 Available"
value_template: >-
{%- if states( 'sensor.cctvquad1_last_seen' ) != 'unknown'
and ( as_timestamp( now() ) - as_timestamp( states( 'sensor.cctvquad1_last_seen' ) ) ) <= 180 -%}
True
{%- else -%}
False
{%- endif %}
- platform: template
sensors:
pi_cctvquad2_on:
friendly_name: "CCTV Quad2 Available"
value_template: >-
{%- if states( 'sensor.cctvquad2_last_seen' ) != 'unknown'
and ( as_timestamp( now() ) - as_timestamp( states( 'sensor.cctvquad2_last_seen' ) ) ) <= 180 -%}
True
{%- else -%}
False
{%- endif %}
group:
pi_cctvquad1_on:
name: "RPi CCTV Quad1"
#control: hidden
entities:
- sensor.cctvquad1_ipv4_address
- sensor.cctvquad1_uptime
- switch.cctvquad1_reboot
- switch.cctvquad1_shutdown
- sensor.cctvquad1_cpu_temperature
- sensor.cctvquad1_cpu_use
- sensor.cctvquad1_ram_use
- sensor.cctvquad1_disk_use
- sensor.cctvquad1_last_seen
pi_cctvquad2_on:
name: "RPi CCTV Quad2"
#control: hidden
entities:
- sensor.cctvquad2_ipv4_address
- sensor.cctvquad2_uptime
- switch.cctvquad2_reboot
- switch.cctvquad2_shutdown
- sensor.cctvquad2_cpu_temperature
- sensor.cctvquad2_cpu_use
- sensor.cctvquad2_ram_use
- sensor.cctvquad2_disk_use
- sensor.cctvquad2_last_seen
#automation:
# - alias: "Home Assistant Start"
# trigger:
# platform: homeassistant
# event: start
# action:
# - service: group.set_visibility
# entity_id:
# - group.pi_cctvquad1_on
# data:
# visible: False
# - alias: "pi is on"
# trigger:
# platform: state
# entity_id:
# - binary_sensor.pi_cctvquad1_on
# from: "off"
# to: "on"
# action:
# - service: group.set_visibility
# data_template:
# entity_id: "group.pi_{{ trigger.entity_id | replace( 'binary_sensor.pi_', '' ) }}"
# visible: True
# - service: group.set_visibility
# data_template:
# entity_id: "group.pi_{{ trigger.entity_id | replace( 'binary_sensor.pi_', '' ) | replace( '_on', '' ) }}_off"
# visible: False
# - alias: "pi not seen"
# trigger:
# platform: state
# entity_id:
# - binary_sensor.pi_cctvquad1_on
# from: "on"
# to: "off"
# action:
# - service: group.set_visibility
# data_template:
# entity_id: "group.pi_{{ trigger.entity_id | replace( 'binary_sensor.pi_', '' ) | replace( '_on', '' ) }}_on"
# visible: False
# - service: group.set_visibility
# data_template:
# entity_id: "group.pi_{{ trigger.entity_id | replace( 'binary_sensor.pi_', '' ) | replace( '_on', '' ) }}_off"
# visible: True
#- service: notify.ios_PHONENAME
#data_template:
#title: "Pi Offline"
#message: "{{ trigger.entity_id | replace( 'binary_sensor.pi_', '' ) | replace( '_on', '' ) }}"
#- alias: 'pi disk use'
#trigger:
#platform: numeric_state
#entity_id:
#- sensor.cctvquad1_disk_use
#above: 90
#action:
#- service: notify.ios_PHONENAME
#data_template:
#title: "Pi Disk Use > 90%"
#message: "{{ trigger.entity_id | replace( 'sensor.', '' ) | replace( '_disk_use', '' ) }}"

View File

@@ -1,7 +1 @@
sensor:
- platform: template
sensors:
electricity_power_total:
friendly_name: "Electricity Power Total"
unit_of_measurement: "W"
value_template: "{{ states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_0') |float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_1') | float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_2') | float }}"