Add set positions to baby monitor

This commit is contained in:
Thomas Lovén 2019-01-13 20:15:28 +01:00
parent ac0deff771
commit be33beb72d
2 changed files with 36 additions and 4 deletions

View File

@ -19,7 +19,7 @@ elements:
entity_id: {{ entity }} entity_id: {{ entity }}
dir: left dir: left
style: style:
left: 10% left: 30px
top: 50% top: 50%
color: yellow color: yellow
@ -32,7 +32,7 @@ elements:
entity_id: {{ entity }} entity_id: {{ entity }}
dir: right dir: right
style: style:
left: 90% right: 6px
top: 50% top: 50%
color: yellow color: yellow
@ -46,7 +46,7 @@ elements:
dir: up dir: up
style: style:
left: 50% left: 50%
top: 10% top: 30px
color: yellow color: yellow
- type: icon - type: icon
@ -59,5 +59,30 @@ elements:
dir: down dir: down
style: style:
left: 50% left: 50%
top: 90% bottom: 6px
color: yellow color: yellow
- type: icon
icon: mdi:numeric-1-box-outline
tap_action:
action: call-service
service: rest_command.camera_position
service_data:
entity_id: camera.barnrum
position: 0
style:
left: 30px
bottom: 0px
color: blue
- type: icon
icon: mdi:numeric-2-box-outline
tap_action:
action: call-service
service: rest_command.camera_position
service_data:
entity_id: camera.barnrum
position: 1
style:
left: 66px
bottom: 0px
color: green

View File

@ -10,6 +10,7 @@ homeassistant:
<<: *common <<: *common
camera.barnrum: camera.barnrum:
<<: *common <<: *common
host: !secret camera_barnrum_host
switch.barnrum_ptz_left: switch.barnrum_ptz_left:
<<: *common <<: *common
@ -74,3 +75,9 @@ script:
- service: camera.onvif_ptz - service: camera.onvif_ptz
data_template: data_template:
entity_id: "{{ entity_id }}" entity_id: "{{ entity_id }}"
rest_command:
camera_position:
url: http://{{ state_attr(entity_id, 'host')}}/web/cgi-bin/hi3510/param.cgi?cmd=preset&-act=goto&-number={{ position }}
username: !secret camera_barnrum_username
password: !secret camera_barnrum_password