-
Notifications
You must be signed in to change notification settings - Fork 34
Home Assistant integration with light example #49
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
base: main
Are you sure you want to change the base?
Conversation
HAMPWS (Home Assistant Micro Python Web Socket) Class, test code, and a demo of a button that can turn a light off and on as well as change state if light changes remotely
Thank you. Could I trouble you to move these into |
Here you go @Gadgetoid |
Thank you, I have a Home Assistant Green set up now, so I'll give this a try ASAP. |
I'm not sure how ASAP translated to "in two months" 💀 but here we are... |
Some feedback:
Generally, though, really awesome! This might be something that warrants its own GitHub repo with documentation and some more examples. Presto is a great light switch 😆 Graphs and charts would be awesome, too. |
this code is certainly flakey but I think I can get it to be more useful in a separate repo as you suggest - I'm gonna rework it as I have another related side project that will let devices like presto (such as galactic unicorn, but also regular raspi's) work with an mqtt broker and plugins kind of similarly to functionality you get with TRMNL (but just python) - I have POC of plugins (weather (POC), google calendar (POC), home assistant (TODO)) and devices (right now just test code running in a shell), but need to harden it and make it work in micropython (the rework of this code) - when I get something a little more useful I'll publish in a an open repo |
Some hackery to allow a Presto to integrate with Home Assistant.
config.py
configuration with host, token, and entity configuration
hampws.py
class to provide access to Home Assistant
hampws_light.py
demonstration of a button that reads state of a light from Home assistant - shows the state on screen as a button either yellow for on or black for off - will continue to read state and update if the light state changes outside of the Presto - will also allow the user to touch the button to turn the light off and on - huzzah!
hampws_test.py
some test code for some of the methods in the class - could do with some improvement for sure - there are some heavy logging outputs here, but for sure will help the user to learn some of the back and forth