-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Bring more Commands to MQTT discovered entities #921
Comments
A simplified idea for the Cruise Waypoints - we wouldn't even have to maintain an updated list of configured waypoints, if the Select entity's discovery config just includes the max number of configurable waypoints (which I believe is up to 4 waypoints max):
And then when the waypoint is selected, look up There would also need to be some testing involved, in order to avoid issues with retaining state of the Select entity, which can't really be retained, because it may change after selecting a waypoint 🤔 In reality is probably makes more sense to treat these as 4 buttons, since buttons would not have a retained state that we have to deal with, and it's really just a one-time action to tell it to move to that position. On the other hand, we could easy do this kind of "point the camera at $X" functionality manually, just by maintaining our own manual set of ptz coordinates somewhere. I was just looking for a way to make it work natively in the HA entity without having to augment those entities with our own helpers. But the more I think of it, maintaining our own list of ptz coordinates actually expands the functionality of the app's waypoints, because we would not be restricted to only 4 to choose from. Since we can have our own configuration of buttons or scripts or whatever, to make it snap to a specific viewport, and independently have a built-in "Pan Cruise" switch that will cycle through the cruise_points. |
It looks like we don't currently cache the resolved list of |
A couple of these are a little tricky.. We can technically SET/change "Res", but it tends to cause issues if we switch the resolution midstream, so that's why I've left this one out. We can't query the value directly, but it should update when requesting param_info or camera_info. See #825 for all the key-values. Signal is another weird one that only get returned on authentication with the camera and there doesn't seem to be a way to update the value without reconnecting. Potential workaround may be to poll the data from the web api? Snapshot is only active when discovery is enabled to avoid spamming the MQTT server with data, but we could make this optional. Audio is more diagnostic and only gets published at setup. We may be able to enable/disable audio in the future. |
Makes sense. I was just noting the overlap and differences between MQTT entities and the Commands list, and trying to identify some that could be candidates for MQTT discovery (though some may not be worth the effort). What you've just added so far is a great start and may be good enough for the majority of users. |
* cache build * Catch and disable MQTT on name resolution error * Doorbell quick response * Set camera time zone #916 * Set timezone on camera #916 * OSD toggle for logo/timestamp * Add K10006 auth #742 * Fix /time_zone/get and return offset #916 * convert TZ offset to hours #916 * custom video filter #919 * Resend discovery message on HA online #907 #920 * Revert K10006 for WYZEDB3 #742 * Add more MQTT entities #921 #922 * Return json response/value for commands #835 * Fix threading issue on restart #902 * Fix SET cruise_points over MQTT * SET cruise_point #835 * split into multiple jobs * changelog
In v2.3.11, I see the new entities on both my pan and non-pan cameras (with pan features correctly appearing only in the pan cameras) 🎉 This is great, thank you! |
@jhansche Added some more entities to the dev branch. Would appreciate some testing and feedback. |
I see the updated entities. The new
There may also be some usability issues with the last selected option remaining selected inside the UI, even if the camera has since moved on - for example, if you select waypoint One option might be to add an empty "" parked value to the options, and whenever the waypoint value is set, publish an update to the waypoint state to switch it back to But that might be a hack, and it may even be better to just make them buttons? Not sure. I tried to test the Minor issue: changing If you do want to take care of removing it, you can do that with an empty discovery payload:
However, because they both have the same topic (/alarm), but different platform (switch vs siren), the MQTT discovery won't differentiate between them, and therefore an empty payload on According to the docs, the topic segment before Maybe it's not a big deal, if the original switch hasn't been released yet (but I think it was in 2.3.11?) |
Unrelated - I did notice that my "Docker Wyze Bridge (dev)" add-on didn't start up when I tried it, to test these. This seems to be related to mrlt8/edge-repo#1 |
Been playing around with the select option for cruise_point, but it seems to be very Any thoughts on handling the PTZ/Rotary Degree commands? Are buttons the only option? |
For rotary, is it ok for the axes to be set separately? Cause two number sliders would probably be easiest. You might be able to throttle sending the command to see if a second coordinate is going to be received 🤔 but that sounds like more effort than it's worth. I've never seen any kind of 2D or 3D controls that would let you pick from that kind of coordinate space at one time. Maybe eventually HA will come up with a way to control this. If you're more interested in directing the camera than absolute positioning, I've only seen D-pad style controls, which would basically be a series of buttons. |
* Start from index 1 for cruise_point/waypoint #835 * update_snapshot via MQTT * fix camera status always online #907 #920 * Additional MQTT entities #921 * QSV related changes * i965-va-drivers #736 * FIX power status #921 * Fix cruise_point type #921 Thanks @jhansche * return index from command payload #921 * Update docker-image.yml * Monitor and set preferred bitrate #929 * Default to `-` for cruise_point #921 * clear out stale entities #921 * changelog
Tested v2.3.12, and the waypoint selection is working great now! |
@jhansche MQTT Cover seems to have an up/down and "rotate" that might be usable for the ptz. I can't seem to get rid of the "stop" button for rotation, but I don't think the button does anything so it shouldn't be an issue. |
That's an interesting use.. so you're thinking open/close position for one axis, and tilt position for the other axis? It would look odd with the native controls, but most people who would be using it probably wouldn't mind that, and would either use scripts for what they need, or some other Lovelace card to make it look the way they want. Could be a useful way to implement it as an all in one entity. |
* PTZ using cover #921 * set min max for rotate button? #921 * only show pan_tilt for pan_cam * Add extra intel packages #736 * Update Dockerfile.hwaccel * Revert "Update Dockerfile.hwaccel" This reverts commit d7de34c. * Update Dockerfile.qsv * Update Dockerfile.qsv * Update Dockerfile.qsv * Fix typo #736 * copy bins #736 * fix typing warnings * remove dot from version check * DEBUG_FFMPEG to FFMPEG_LOGLEVEL * case sensitive FFMPEG_CMD #736 * Add ffmpeg filter_complex config #919 * Adjust bitrate * Skip audio buffer check #388 * Revert "Skip audio buffer check #388" This reverts commit 79ace0c. * changelog
Got a chance to try out the new Cover entity for pan and tilt. Gotta say it's pretty slick 😎 I'm a little confused about the initial control that appears, before switching it to the d-pad style controls. I'm not really sure what that slider is doing. It really just caused it to kind of shift left and right maybe a few degrees, but never beyond those few degrees in either direction, no matter how far the slider is moved. But the tilt control is definitely intuitive, and the stop button in the center is hardly noticeable. |
Is it possible to add "Privacy mode" toggle for the Pan camera? i would like to create a flow where the camera goes off when i'm home and on when i'm not. thanks! |
@joeblack2k as explained earlier in this issue, "Privacy mode" is nothing more than "power off". That switch already exists. |
Not sure if this has been discussed, or if perhaps i missed it; I have a few cameras with Wyze Spotlights attached, and it would be jim-dandy to be able to turn the light on/off via REST API or MQTT. My use case: The cameras are monitoring biological cultures which are supposed to stay in the dark, but I want to be able to monitor them remotely. (I'm already using Wyze cams and docker-wyze-bridge to monitor other things in the lab.) I was hoping to use a Wyze Spotlight and write an automation in Home Assistant (MQTT entity or script via REST if necessary) to turn on the light, take a snapshot, and turn the light off. |
Will look into it! There seem to be several floodlight related commands available in the app, so we may be able to add some support:
|
@tensiondriven I added some commands for the WYZEC3L spotlight. Would appreciate if you could try to set
|
* trigger interval snapshots via web API #1030 * Add support for V4 and Doorbell V2 #1024 * Newer auth protocol and fw11 bitrate check #1024 * Add commands for spotlight and accessories #921 * Revert "Update MediaMTX version from v1.1.1 to v1.2.1 (#1016)" This reverts commit 8f6767a. * Add latest fw version #1026 * changelog
@mrlt8 here are the get values from my spotlight
Similar responses for the
Converting the integers values in the
|
Thank you @ralacher! |
@mrlt8 it does not -- here are the results.
|
@ralacher My bad, I meant:
|
@mrlt8 ah yeah, that does work. Saw the spotlight itself turn on/off and saw the updates occur in the Wyze app.
Should the floodlight accessory work as well? I get an error message when I try my flood light camera and accessory.
|
Awesome! No, I haven't added the set commands for the floodlight yet. Will look into it when I have a chance! |
Thanks so much! Really appreciate all your work on this project. |
Current commands:
https://github.com/mrlt8/docker-wyze-bridge/wiki/Camera-Commands
Entities exposed via discovery: https://github.com/mrlt8/docker-wyze-bridge/blob/main/app/wyzebridge/mqtt.py#L184
A few things that would be helpful:
Update
Camera-Commands
to add a column for "exposed via discovery"Current Commands that would become checked:
Not listed under Commands, but available via discovery (may not be needed in Commands, just being thorough):
Additional commands that are not exposed by discovery, but would be useful (depending on the capabilities of the camera):
In the case of "Pan Cruise waypoints", as an MQTT Select entity, the bridge can do the heavy lifting by:
cruise_points
, publish discovery config for that camera, with the list ofoptions: ["Waypoint 1", "2", .. "4"]
depending on the number of configured waypoints. Optionally: periodically, or in response to other GET or SET requests ofcruise_points
, re-publish the updated discovery config with the updatedoptions
list, if it changed.options
in the select entity, which will be one of "waypoint 1" .. "4", re-query cruise_points (or cache/retain the last known configured waypoints from the last GET request), and then send theptz_position
command for that waypoint's coordinates. This is what was mentioned in Have the ability to use API/MQTT to change which waypoint to view #835 (comment) but with the new proposal being that we can support it natively in the add-on, without having to reimplement that functionality via external helpers/scripts to do it. This becomes even harder to do manually, as a result of the weird non-json value reported in Have the ability to use API/MQTT to change which waypoint to view #835 (comment)Others that could be supported, but may not add much value?
The text was updated successfully, but these errors were encountered: