Comments (5)
Hi there - that's about as good as you can get with current functionality - unlike listen_state()
, listen_event()
is pretty simple, it responds to the named event and hands the data over.
This is partly because I haven't had a more complex usecase - I use custom events myself, but only in a simple way. However, there is no reason I couldn't expand it to handle the usecase of listening for specific attributes as is possible in listen_state()
- to be somewhat consistent with listen_state()
I would probably do something like:
self.listen_event(self.cycle_scene, 'zwave.scene_activated', attribute="scene_id", value=self.scene_id)
Does that sound like it would work?
FWIW, I have a minimote too but haven't gone through the hassle of setting it up for HA yet, so maybe I will do so so I can test this feature :)
from appdaemon.
That sounds perfect! Thank you very much :D
from appdaemon.
OK, I will add it to the list, but for now you have a working setup :)
from appdaemon.
Got my minimote working and I have added filtering to the listen state call - it has info in the API file but here are a couple of examples of what I ended up with:
Listen for a minimote event activating scene 3:
self.listen_event(self.generic_event, "zwave.scene_activated", scene_id = 3)
Listen for a minimote event activating scene 3 from a specific minimote:
self.listen_event(self.generic_event, "zwave.scene_activated", entity_id = "minimote_31", scene_id = 3)
I am calling these "event filters" and you can use them to filter for any arguments in any event.
I am just about to push the release with this in - 1.3.3.
from appdaemon.
Thank you so much for this! (Sorry for the delay - circling back to automation stuff now).
Looking forward to cleaning up the code I have.
from appdaemon.
Related Issues (20)
- after upgrade to 0.15.1 it stop afer few second HOT 2
- Script wiped out after upgrade to 15.0 / 15.2 HOT 3
- Not Starting in Home Assistant with Latest Update HOT 2
- What Have you done? HOT 5
- appdaemon folder emptied on Nov 16? HOT 3
- Render template seems to have problems with special characters
- Not start anymore HOT 1
- Allow apps.yaml path to be configured
- Documentation to point to new configuration location HOT 5
- Weirt example in `Choosing a Start Time`
- Issue logging DEBUG level log entries HOT 2
- Add support for service calls that return data such as todo/get_items HOT 3
- Logging (self.log) does not properly handle encoding of some non-English characters. HOT 1
- Schedy App/script not working after update Appdaemon add-on to 0.15.2
- Add ability to trigger a manual check_app_update or to set a custom interval (or: is utility_delay safe to change?)
- Throw an error / refuse to load if apps.yaml has a duplicate top-level key HOT 2
- Double reset_timer set execution time to first time set
- Python 3.12 support HOT 4
- Python package imports - "expert mode" HOT 1
- Warning about "secrtets" from apps where yaml is commented out
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appdaemon.