Coder Social home page Coder Social logo

Comments (5)

sebr avatar sebr commented on July 22, 2024

Hi @pghpete neat use case!

You could do all of this today if you installed Home Assistant on your RPI :).

This repo is a bit out of date - I maintain bhyve-home-assistant which includes a newer and improved pybhyve implementation in it. You could take a look there for inspiration.

That said, the bhyve-home-assistant repo is designed to be dropped into Home Assistant and enable you to monitor and control bhyve devices with automations (eg motion detection)!! From your description, it would be a great candidate to help you manage your irrigation and weather based automations.

That said, it sounds like you've invested a fair bit into your existing system setup (but I do promise, if you setup Home Assistant you'll be properly hooked).

Unfortunately it's not so simple to turn the devices on or off as REST api is only used to retrieve device information. All device modifications and events are sent through a websocket API. You could take some inspiration from here: https://github.com/sebr/bhyve-home-assistant/blob/main/custom_components/bhyve/pybhyve/client.py#L145

from pybhyve.

pghpete avatar pghpete commented on July 22, 2024

Thanks for your reply! I have dabbled with home assistant and it's on my list of projects to do this winter. :-) So if I am understanding this correctly your websocket python code may be able to be used here?

Yeah the overall goal here is to make these for a family members 60,000 square feet of greenhouses and several acres of fields. (For his small company). I'm on my second version and summer of testing, but eventually the goal is to have them be stand-alone with a cellular internet connection and solar powered by the same panel that runs the well pumps. Every connection, both for the raspberry pi and all external sensors and relays is broken out to a water proof connection point on the box (including 2 usb connections, and an hdmi connection) so someone can just roll up to one with a keyboard and small portable monitor and connect to it (for upgrades and diagnostics) without having to move the box or disconnect any of the sensors.

Here are some shots of it.

20200529_144404

20200528_233421

Being for a family members tiny company I'll eventually just charge him for the cost of parts. :-)

The b-hyve just seamed like a good test device to use as a master shut-off. Especially since they use the Espressif ESP32 boards inside. I haven't cracked one of them open for some hardware hacking yet but that is likely going to happen at some point. :)

from pybhyve.

sebr avatar sebr commented on July 22, 2024

Very nice @pghpete

I've just updated pybhyve to synch it with the latest implementation. You should now be able to use the examples to both pull data from the rest api or listen (or send) websocket events. If you want to see how to turn a device on or off, see switch.py. You'll have to first pull all the device data using client.devices and parse it.

from pybhyve.

pghpete avatar pghpete commented on July 22, 2024

from pybhyve.

sebr avatar sebr commented on July 22, 2024

Cheers mate, I'll close this issue for now. Feel free to reach out for anything else!

from pybhyve.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.