Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Add button like picture glance #172

Closed
PilaScat opened this issue Nov 29, 2021 · 23 comments
Closed

[FEATURE REQUEST] Add button like picture glance #172

PilaScat opened this issue Nov 29, 2021 · 23 comments
Labels
enhancement New feature or request

Comments

@PilaScat
Copy link

image
Very useful for opening gates, switch lights or tts

@andiukas
Copy link

andiukas commented Dec 6, 2021

Try ;)
image

@PilaScat
Copy link
Author

PilaScat commented Dec 6, 2021

Thanks, but was better directly in webrtc ui

@AlexxIT AlexxIT added the enhancement New feature or request label Dec 7, 2021
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 7, 2021

You can check this in latest master version:
#169

@PilaScat
Copy link
Author

PilaScat commented Dec 7, 2021

Thanks, it's already on the latest release?

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 7, 2021

No. Only in master version

@andiukas
Copy link

andiukas commented Dec 8, 2021

Not works
021-12-08 07:50:45 ERROR (MainThread) [frontend.js.latest.202112060] https://xxxxxxxxxxxxxxxxxxxxxxxxxx:8123/webrtc/webrtc-camera.js?v2.0.2:332:22 Uncaught TypeError: Cannot read properties of undefined (reading 'callService')

@dmamontov
Copy link
Contributor

Not works
021-12-08 07:50:45 ERROR (MainThread) [frontend.js.latest.202112060] https://xxxxxxxxxxxxxxxxxxxxxxxxxx:8123/webrtc/webrtc-camera.js?v2.0.2:332:22 Uncaught TypeError: Cannot read properties of undefined (reading 'callService')

Settings and file content please. So what version of hass do you have?

@andiukas
Copy link

Not works
021-12-08 07:50:45 ERROR (MainThread) [frontend.js.latest.202112060] https://xxxxxxxxxxxxxxxxxxxxxxxxxx:8123/webrtc/webrtc-camera.js?v2.0.2:332:22 Uncaught TypeError: Cannot read properties of undefined (reading 'callService')

Settings and file content please. So what version of hass do you have?

Everything is fine, I didn't add a feature: ui: true

@PilaScat
Copy link
Author

image
with buttons it shows entity state, is possible to have the same thing here? like with picture glance?

@dmamontov
Copy link
Contributor

through card-mod you can do

example:

type: custom:webrtc-camera
style: |
  .shortcuts > .shortcut-0 {
    color: {% if is_state('switch.xiaomi_dafang_record', 'on') %}
              #df4d1d
           {% else %}
              white
           {% endif %};
    animation: {% if is_state('switch.xiaomi_dafang_record', 'on') %}
                  1s ease 0s infinite normal none running pulse;
               {% else %}
                  none
               {% endif %};
  }
  .shortcuts > .shortcut-1 {
    color: {% if is_state('switch.dafang_night_mode_2', 'on') %}
              var(--paper-item-icon-active-color, #fdd835)
           {% else %}
              white
           {% endif %};
  }
entity: camera.dafang3
ui: true
shortcuts:
  - name: Запись
    icon: mdi:record-circle-outline
    service: switch.toggle
    service_data:
      entity_id: switch.xiaomi_dafang_record
  - name: Ночной режим
    icon: mdi:theme-light-dark
    service: switch.toggle
    service_data:
      entity_id: switch.dafang_night_mode_2
  - name: Перезагрузить
    icon: mdi:refresh-circle
    service: switch.toggle
    service_data:
      entity_id: switch.xiaomi_dafang_power

@PilaScat
Copy link
Author

Thanks

@mash2k3
Copy link

mash2k3 commented Dec 15, 2021

Does the shortcuts also support entity states where icons change color for example the cameras motion?

@dmamontov
Copy link
Contributor

Does the shortcuts also support entity states where icons change color for example the cameras motion?

o wrote above. you can use card_mode

@PilaScat
Copy link
Author

But with that I can't see other status, like images for plex or light color

@mash2k3
Copy link

mash2k3 commented Dec 16, 2021

Thought it would be easier and cleaner if it was built in since the function already exists in HA instead of adding custom CSS

@dmamontov
Copy link
Contributor

it will turn out a little differently and it will be necessary to re-saw all the js that is connected. but such a principle is possible.

@nkgiovannivl
Copy link

Hi, I'm trying to add my presets ONVIF, but how can chage position (bottom center) and text (white) and background (black) to my shortcuts? Thanks!

image

@dmamontov
Copy link
Contributor

Hi, I'm trying to add my presets ONVIF, but how can chage position (bottom center) and text (white) and background (black) to my shortcuts? Thanks!

first, you need the version from the wizard. secondly, the card-mod component is required.

@nkgiovannivl
Copy link

Hi, I'm trying to add my presets ONVIF, but how can chage position (bottom center) and text (white) and background (black) to my shortcuts? Thanks!

first, you need the version from the wizard. secondly, the card-mod component is required.

Thanks! I did not know about card mod!

image

@fgonza2
Copy link

fgonza2 commented Jan 5, 2022

can you do somehow picture-elements, so you have an overlay of say a temperature sensor icon and value on the camera image?

@Liam-Whiteside
Copy link

Is there any way to put sensor icons overlayed on the webrtc-camera card eg change an icon (ideally the icon and colour) when there's motion detected?

I haven't been able to get things like this to work:

title: Drive Cam via WebRTC
type: custom:webrtc-camera
entity: camera.drive_camera
muted: true
ui: true
shortcuts:
  top: 25
  left: 5
  services:
    - name: Motion
      icon: >
        {% if is_state('binary_sensor.drive_camera_motion', 'Detected') return
        'mdi:motion-sensor'; else return 'mdi:motion-sensor-off'; %}

@dmamontov
Copy link
Contributor

@Liam-Whiteside I think you can solve it with template sensor

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 2, 2023

style settings supported from integration v3

@AlexxIT AlexxIT closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants