使用正常,需要在真机环境下sudo pip install pjlink
然后在ha里添加pjlink switch
switch:
- platform: command_line
switches:
tyj101:
command_on: "pjlink -p 192.168.1.211 power on"
command_off: "pjlink -p 192.168.1.211 power off"
command_state: "pjlink -p 192.168.1.211 power"
value_template: "{{ value == 'on' }}"
friendly_name: 一楼会议投影 #支持中文
tyj103:
command_on: "pjlink -p 192.168.1.213 power on"
command_off: "pjlink -p 192.168.1.213 power off"
command_state: "pjlink -p 192.168.1.213 power"
value_template: "{{ value == 'on' }}"
friendly_name: 二楼会议投影 #支持中文
media_player:
- platform: pjlink
host: 192.168.1.211
- platform: pjlink
host: 192.168.1.213
homeassistant:
customize:
switch.tyj101:
icon: mdi:projector
assumed_state: false
switch.tyj102:
icon: mdi:projector
assumed_state: false
switch.tyj103:
icon: mdi:projector
assumed_state: false
|