question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Docs: ha automation example is not suitable for testing with one camera

See original GitHub issue

trigger.{to|from}_state.state in my configuration is a name of camera

I have only one camera, so that state never changes.

condition:
  - condition: template
    value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'

Please consider providing better example for users with one camera and without spamming with notifications. Maybe some timer ? I don’t know… how to solve this

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

1reaction
NickM-27commented, Mar 20, 2022

Even if I use “single” mode as you suggested ?

So there are some wires getting crossed here. The single mode suggestion was to make it so notifications only came in once every x seconds. This would not work with two people coming in at the same time, just like a motion-sensor-like version, because it still holds one state at a time.

It really comes down to priorities, if you have a priority of not so many notifications then a timer will work at the cost of not working for two people coming in at the same time. If make sure it always sends a notification for multiple people that enter at the same time then the default automation will send many notifications. It is possible to get both but will take crafting of the automation and conditions instead of just using the basic example that was provided in the docs (which is meant to be built upon for specific use cases).

The solution to get the behavior you want in both cases is to not use a timer and instead allow double-take with a automation mode of “parallel” and add conditions comparing the from_state and to_state to only fire when useful information is preset. Currently that sensor in the automation example will send a new notification on every snapshot that double-take finds.

0reactions
boehser-enkelcommented, Aug 30, 2022

If you only have one camera you can use the same logic just do trigger.to_state.state.attributes.id and same for the from_state

So: ‘{{ trigger.to_state.state.attributes.id != trigger.to_state.state.attributes.id }}’ & ‘{{ trigger.from_state.state.attributes.id != trigger.from_state.state.attributes.id }}’

That does not work. The automation does not get triggered

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error for all automation conditions "Unsupported ...
I am getting an error on all my automations; I could have sworn they were all working fine a few days ago. I've...
Read more >
Generic IP camera - was working on 2022.3.8, stopped after ...
The problem Cameras were working fine, after upgrade to 2022.4.0 they aren't loading anymore. I can play normally from VLC.
Read more >
Frigate and Home Assistant - YouTube
An indepth look at how Frigate integrates into Home Assistant. Using the Frigate HACS integration we can look at our live video streams, ......
Read more >
Install Bot Agent and register device
Prerequisites · A Bot Creator can log in and access both Automation 360 and Enterprise 11 client to create bots. · Attended Bot...
Read more >
Awesome Home Assistant
Home Assistant is an open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found