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

Sensor Status Updates #50

Merged
merged 4 commits into from
Nov 28, 2020
Merged

Sensor Status Updates #50

merged 4 commits into from
Nov 28, 2020

Conversation

AK5nowman
Copy link
Collaborator

Add support for sensor status updates (battery notifications). Credits to maage89 for putting the pieces together.

Added an "event" property to the mqtt message that is pusblished. Event type "alarm" is the sensor triggerings. Event type "status" is the sensor checking in.

@AK5nowman AK5nowman changed the title Main battery Sensor Status Updates Nov 23, 2020
@AK5nowman
Copy link
Collaborator Author

Should note, I don't use HA so not sure if the discovery topic payload needs to change to support this.

@raetha
Copy link
Owner

raetha commented Nov 28, 2020

Nice job! I think I'll need to do some things to make it more HA friendly, but at least the updates will go through. I may end up creating a new alarms topic for each sensor, but will probably wait until I can see what it looks like and try to get HA to trigger.

Side question, how are you using this stuff? I'm happy to have it get more use, but had figured mostly only HA folks were interested.

@raetha raetha changed the base branch from master to devel November 28, 2020 04:14
@raetha raetha merged commit 584288c into raetha:devel Nov 28, 2020
@raetha raetha added this to the 1.2 milestone Nov 28, 2020
@raetha raetha added the enhancement New feature or request label Nov 28, 2020
@raetha raetha self-requested a review November 28, 2020 04:25
@raetha raetha removed their assignment Nov 28, 2020
@raetha raetha mentioned this pull request Nov 28, 2020
Merged
@AK5nowman
Copy link
Collaborator Author

I use node-red solo. I work in the industrial automation world so the whole yaml based automations wasn't all that intuitive so I scrapped it after a few days of playing with it. Only thing I'm missing is a nice control dashboard. Right now I just use iOS and setup a quick https2mqtt so I can make http calls from iOS shortcuts to publish stuff to my broker, lets me control my lights easy enough.

I'd love to scrap node-red in favor of a software PLC with a MQTT connector but I haven't had much luck finding one.

@raetha
Copy link
Owner

raetha commented Nov 30, 2020

I hear you on the HA automation yaml, which is why I use node-red in parallel with HA. Got both running in docker and interconnected. Most of my automations, including notifications and alerts, trigger via node-red flows, but based on the status and control functions in HA. They actually play really well together and give a nice UI to interact with things, while having better automation than HA started with.

That said, I know HA has put a ton of work into the GUI for their automation stuff, and you almost never need to jump into yaml anymore. I keep meaning to take a look and see if I can eventually replace node-red.

Side note on these changes specifically, I'm not seeing any status triggers since updating my instance. Have you actually seen both the status and alert messages coming through? Wondering if you made some further tweaks that got missed here, or if something isn't working right in my environment.

@AK5nowman
Copy link
Collaborator Author

That's really interesting. Most of my sensors are triggered often enough to not need these status messages but the couple that I paired after making this change just sitting on my desk regularly (not periodically though) send me status messages. It appears to never go longer than 181 minutes before sending a status message. And I see as soon as 19 minutes. When comparing branches I don't think I missed anything, ill take another look after work today and report back

@trankillity
Copy link

Totally off topic to the PR itself (which is fantastic to have merged!), but you both may wish to investigate AppDaemon (Python) or NetDaemon (C#) depending on your preferred language/poison. I find them much more flexible and re-usable than using Node-RED for my automations.

@AK5nowman
Copy link
Collaborator Author

@trankillity I had seen AppDaemon but not NetDaemon. C# is by far my preferred language so I will have to keep NetDaemon in mind. Thanks!

Update on my Status messages: Turns out the message is periodic with a 4hr period, regardless if alarms are triggered or not. They all seem to be 30 minutes out of phase with each other, though.

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

Successfully merging this pull request may close these issues.

3 participants