This thread is awesome! Building upon these posts, I was able to get this working without using curl, control the tablet display using a light template (on, off, brightness). I can select which dashboard (appdaemon/hadashboard) to display with input select and templated rest_command
Video demo
packages/tablet_master_bedroom.yaml
homeassistant:
customize:
sensor.tablet_mbr_screen_brightness:
hidden: true
binary_sensor.tablet_mbr_screen_on:
hidden: true
input_number.tablet_mbr_temp_screen_brightness:
hidden: true
light:
- platform: template
lights:
tablet_mbr_screen:
friendly_name: "Master Bedroom Tablet"
level_template: "{{ states('sensor.tablet_mbr_screen_brightness') }}"
value_template: "{{ is_state('binary_sensor.tablet_mbr_screen_on', 'on') }}"
turn_on:
service: rest_command.tablet_mbr_screen_on
turn_off:
service: rest_command.tablet_mbr_screen_off
set_level:
service: script.tablet_mbr_screen_value
data_template:
brightness: "{{ brightness }}"
rest_command:
tablet_mbr_screen_on:
url: 'http://KioskIP:2323/?cmd=screenOn&type=json&password=KisokPassword'
method: post
tablet_mbr_screen_off:
url: 'http://KioskIP:2323/?cmd=screenOff&type=json&password=KisokPassword'
method: post
tablet_mbr_screen_value:
url: 'http://KioskIP:2323/?cmd=setStringSetting&key=screenBrightness&value={{states("input_number.tablet_mbr_temp_screen_brightness") | int }}&type=json&password=KisokPassword'
method: post
tablet_mbr_url_bed:
url: 'http://KioskIP:2323/?cmd=loadURL&url=http://DashboardIP/{{ states("input_select.tablet_mbr_dash_select") }}&type=json&password=KisokPassword'
method: post
input_select:
tablet_mbr_dash_select:
name: Dash Display
icon: mdi:tablet
initial: "-"
options:
- "-"
- bedroom
- laundry
- doorbell
- fire_menu
- den
input_number:
tablet_mbr_temp_screen_brightness:
name: tablet_mbr_temp_screen_brightness
initial: 128
min: 0
max: 255
step: 1
sensor:
- platform: rest
name: tablet_mbr_battery_level
json_attributes:
- batteryLevel
resource: http://KioskIP:2323/?cmd=deviceInfo&type=json&password=KisokPassword
value_template: '{{ value_json.batteryLevel }}'
unit_of_measurement: '%'
- platform: rest
name: tablet_mbr_screen_brightness
json_attributes:
- screenBrightness
resource: http://KioskIP:2323/?cmd=deviceInfo&type=json&password=KisokPassword
value_template: '{{ value_json.screenBrightness }}'
binary_sensor:
- platform: rest
name: tablet_mbr_screen_on
json_attributes:
- isScreenOn
resource: http://KioskIP:2323/?cmd=deviceInfo&type=json&password=KisokPassword
value_template: '{{ value_json.isScreenOn }}'
- platform: rest
name: tablet_mbr_plugged_in
json_attributes:
- plugged
resource: http://KioskIP:2323/?cmd=deviceInfo&type=json&password=KisokPassword
value_template: '{{ value_json.plugged }}'
media_player:
- platform: mpd
name: mbr_tablet_mpd
host: KioskIP
automation:
- id: tablet_mbr_change_url
alias: Tablet Master Bedroom Change URL
trigger:
platform: state
entity_id: input_select.tablet_mbr_dash_select
condition:
condition: template
value_template: '{{ not is_state("input_select.tablet_mbr_dash_select", "-") }}'
action:
- service: rest_command.tablet_mbr_url_bed
entity_id: rest_command.tablet_mbr_url_bed
- service: input_select.select_option
data:
entity_id: input_select.tablet_mbr_dash_select
option: "-"
- id: tablet_mbr_display_doorbell
alias: Display in Master Bedroom when doorbell activated
trigger:
platform: state
entity_id: binary_sensor.door_bell
to: 'on'
action:
- service: input_select.select_option
data:
entity_id: input_select.tablet_mbr_dash_select
option: "doorbell"
script:
tablet_mbr_screen_value:
sequence:
- service: input_number.set_value
data_template:
entity_id: input_number.tablet_mbr_temp_screen_brightness
value: "{{ brightness }}"
- service: rest_command.tablet_mbr_screen_value
group:
tablet_mbr:
name: Tablet Master Bedroom
control: hidden
entities:
- light.tablet_mbr_screen
- input_select.tablet_mbr_dash_select
- sensor.tablet_mbr_battery_level
- binary_sensor.tablet_mbr_plugged_in