+1
Until someone has arranged it (if anyone wants to build it) there is a way to send the data to Domoticz by HA using a json call.
I still had a PI somewhere and decided to test with HA this weekend. The disadvantage is that HA has to run next to Domoticz, but it works until, of course, someone makes it suitable for Domoticz.
Here is an example of how you can set this up in HA.
configuration.yaml:
Code: Select all
media_player:
- platform: androidtv
host: 192.168.1.36
name: "NVidia Shield"
adb_server_ip: 127.0.0.1
adb_server_port: 5037
state_detection_rules:
'com.plexapp.android':
- 'paused':
'media_session_state': 3 # this indentation is important!
'wake_lock_size': 1 # this indentation is important!
rest_command:
shield_playing:
url: 'http://192.168.1.11:8080/json.htm?type=command¶m=switchlight&idx=63&switchcmd=On'
shield_pause:
url: 'http://192.168.1.11:8080/json.htm?type=command¶m=switchlight&idx=63&switchcmd=Off'
automations.yaml: (testing for Netflix)
Code: Select all
- id: '1584909354303'
alias: 'Netflix playback: "playing" '
description: 'Update Domoticz UV if Netflix is playing on Shield Android TV '
trigger:
- entity_id: media_player.nvidia_shield
platform: state
to: playing
condition:
- condition: template
value_template: '{{ states.media_player.nvidia_shield.attributes.app_name == "Netflix"
}}'
action:
- data: {}
service: rest_command.shield_playing
- id: '1584909833684'
alias: 'Netflix playback: "paused" '
description: 'Update Domoticz UV if Netflix is paused on Shield Android TV '
trigger:
- entity_id: media_player.nvidia_shield
platform: state
to: paused
condition:
- condition: template
value_template: '{{ states.media_player.nvidia_shield.attributes.app_name == "Netflix"
}}'
action:
- data: {}
service: rest_command.shield_pause