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

Support for Notifications #78

Open
maziggy opened this issue Oct 6, 2024 · 6 comments
Open

Support for Notifications #78

maziggy opened this issue Oct 6, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@maziggy
Copy link
Contributor

maziggy commented Oct 6, 2024

I just added a T3 humidifier to my setup and found out, that the humidifier will only sent a notification to the AC Infinity app when the water tank is empty. Would be very nice to get the notifications in HA.

BTW: for the humidifier there is also an additional option called "target humidity" (see screenshot). I already added it ot my setup, but perhaps you wanto to include this also.

Thanks, Martin

Screenshot 2024-10-06 at 13 54 06
@dalinicus dalinicus added the enhancement New feature or request label Oct 6, 2024
@dalinicus
Copy link
Owner

I haven't worked with the home assistant notification API yet, but I'll see what I can do. In the meantime, the missing humidity control is an easy fix. Coincidentally, I literally just picked up a humidifier myself; freshly dropped off from amazon this morning, so I'll have a device to test with. 😆

@maziggy maziggy changed the title Support for Notofications Support for Notifications Oct 6, 2024
@almighty059
Copy link

almighty059 commented Nov 5, 2024

I agree that the addition of notifications would be nice but is that even possible? I'm trying to think of another integration that incorporates some type of popup notification but I can't think of any. Would they have to be displayed as a state of some type of notification entity? Also, are there any important notifications other than low water level from the humidifier?

I was brainstorming this and Idk if it's one in the same but besides the low water level appearing as a notification in the app it also appears in the History Logs. Since alert notifications are temporary, would a permanent event in the History Log be a better way to approach this? The History Logs also don't seem to be used that much because according to mine, "water level is low" and "safety shut-off activated" are the only two events that have ever been recorded. The safety shut-off event is related to the water level and seems to occur right before the humidifier is completely empty. (Note: I have two humidifiers, one is the original model and the other is the gen two model. The original model does not seem to produce the "safety shut-off activated" event opposed to the gen two model which does, but I'm not 100% sure.)

Just to throw out an idea, is there a way to incorporate the History Log of the app into the Logbook of the HA integration? If so, could that logged event be used to trigger an automation which the HA user can then use to create an alert notification of their own liking? Or could an entity be created which acts as a boolean that is true when a low water event is logged and false when the humidifier state is back to functioning as normal? Although I'm not sure how effective that would be because I think there's an issue with the humidifier state that when it runs out of water the Current Power or something similar still shows as it being on and working.

Regarding other notifications, the only additional one I can think of is the popup warning when changing the Device Type in the app. However, you should first know that the initial Device Type that the controller automatically detects and sets in the app is not being shown as the state of the Device Type entity in the integration. Instead, the entity in the integration is blank and has to be manually set. They only sync up after the Device Type is changed to something other than what it has been initially set to in the app. Can this be changed to sync up from the start? (Let me know if I should make this a separate issue) As for the notification, if there's a change to the Device Type in the app to something other than what the controller detected, attempting to Confirm that change will trigger a popup warning that states "A different device type is detected. Current programming may be affected." and the choice of Ok or Cancel. Could this warning also be triggered when attempting the same change in the integration? Or since there currently is no warning in the integration should the ability to change it even be an option? I like having the device type shown but now I'm questioning whether the entity should just provide the state or also allow it to be changed, especially since it's set automatically and could affect the programming of the port if changed.

@maziggy, for what it’s worth, here’s how I currently handle the low water level situation with the humidifier. I created an automation that triggers when the humidity level of my grow tent drops to 10% or more below the humidity level at which my humidifier is set to turn on. The automation then includes a condition that checks to ensure that the Active Mode is set to anything other than "Off" to avoid accidental triggering when the humidifier is intentionally turned off. If these conditions are met, the automation then runs actions that change the background color of a button on my dashboard to red, plays a TTS announcement on my Alexa devices, and sends a notification to my Android phone which all let me know the humidifier needs water. The logic behind the automation triggering is that the humidifier must have run out of water for the humidity level in the tent to drop 10% lower than what it should be. I know this is not the ideal solution, but it serves as a workaround.

@maziggy
Copy link
Contributor Author

maziggy commented Nov 8, 2024

No worries, it's only a nice to have. Thanks for your work!

BTW: I also just purchased a 69Pro+ but couldn't resist to pre-order the new AI controller :)

@dalinicus
Copy link
Owner

Thanks for the suggestions @almighty059

@maziggy I haven't had the time to sit down with this one, so I wouldn't rule it out just yet.

I actually just picked up a humidifier and heater myself, so I'll have hardware to test it with. My concern is though if the data for notifications is available from the API or if they use some other messaging protocol.

Idk we'll see lol. Hopefully have some time here soon.

@maziggy
Copy link
Contributor Author

maziggy commented Nov 9, 2024

Since my humdifier was just running out of water, I captured network traffic to acinfinityserver.com. After looking at the capture file I couldn't find anything related to the notification. So I guess it's not sent via the same server. I'll repeat the test and capture the complete traffic.

I've also compared the API data in the timeframe the notification was sent. The only thing I could find is

Member: abnormalState
[Path with value: /data/[]/deviceInfo/ports/[]/abnormalState:1]
[Member with value: abnormalState:1]
Number value: 1
Key: abnormalState
[Path: /data/[]/deviceInfo/ports/[]/abnormalState]

Default value is 0 but I'm not sure if that has something to do with notifications.

Will keep you updated.

@maziggy
Copy link
Contributor Author

maziggy commented Nov 9, 2024

Just captured the complete traffic and couldn't find anything related to the notification message. So I guess the above abnormalState = 1 triggers the notification.

Binary file ./PlugIns/AC Infinity Push Server.appex/AC Infinity Push Server matches
@@@@@@@@@@@@@@@water level is low. Refill the water tank to resume operation.

What do you think?

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

3 participants