Live data from Hacker News

Run Your Home on a Raspberry Pi

pragprog.com

271–276 of 276 posts

Re: Run Your Home on a Raspberry Pi

#271

Earlier quoted context omitted.

For folks here I strongly recommend installing the appdaemon integration and just writing python scripts. The downside is there is a good bit of learning curve and time investment just to get the hello world going (turn on a light at sunset?). Once you are there, you can write shared libraries, abstract away whatever you want, have legit tests, and just do anything you would normally want in your coding environment (…

Fully agree. Interested about the tests though. I’m not a professional python developer but would love automated tests for my appdaemon code. How did you set it up, and how do you run the tests?

I used https://pypi.org/project/appdaemon-testing/. You can write a simple test file which does things like sets a device state, then asserts that services were called or whatnot.

It doesn't test that the service calls are correctly written, just that they were made. So, very useful for unit testing syntax / logic, but not a full end-to-end integration test solution. Still, with python being an interpreted language, this is super useful. I don't want to have to wait for it actually to be sunset to determine I have a syntax error in that branch of the code, for example.

I don't actually have the tests running on the HA device. I have them on my desktop where I develop the appdaemon scripts, and then I copy only the scripts over to HA. I'm sure there are multiple ways to do it.

Re: Run Your Home on a Raspberry Pi

#272

Earlier quoted context omitted.

Fully agree. Interested about the tests though. I’m not a professional python developer but would love automated tests for my appdaemon code. How did you set it up, and how do you run the tests?

I used https://pypi.org/project/appdaemon-testing/ . You can write a simple test file which does things like sets a device state, then asserts that services were called or whatnot. It doesn't test that the service calls are correctly written, just that they were made. So, very useful for unit testing syntax / logic, but not a full end-to-end integration test solution. Still, with python being an interpreted language,…

Thank you, that’s helpful.

Re: Run Your Home on a Raspberry Pi

#273
post #241
post #229

Earlier quoted context omitted.

Do I really need to do Home Assistant Operating System? It stresses me out that this is not just some packages I can install.

No. Install Raspbian light, docker, docker compose, and HA docker container. Use an SSD drive for boot and official pi ac power.

i have a NUC i plan to dedicate. i seem to recall that there were some features missing from the installs that were not managed (or whatever the Whole OS thing was called?

Re: Run Your Home on a Raspberry Pi

#274
post #95

Earlier quoted context omitted.

Have your written up your implementation? What type of air quality sensors have you used and how are they integrated into the home’s behavior?

I have done a bunch of writeups, in this category [1] The weather station post in particular with the sensors is here [2] [1] https://partofthething.com/thoughts/category/electronics-and... [2] https://partofthething.com/thoughts/weather-and-air-quality-...

Thank you.

Re: Run Your Home on a Raspberry Pi

#275

Earlier quoted context omitted.

> All my lights have a physical switch or button. Maybe it's just the UK, but I struggle to find any suitable physical switches that both look like a normal light switch but also function with smart devices. I understand the benefits of some automation, but if there isn't a 'normal' switch that works completely 'as expected' for the family to use, it's not worth the trouble.

What do you consider 'as expected'? Personally I want switches that will turn off when flicked down, and turn on when flicked up. On the other hand, 3 way switches have already broken that rule so instead, toggling a switch will always toggle the light regardless of its position. If that toggling is okay with you, I've heard good things about Shelly which you can use to convert a regular switch to be smart. Otherwise…

It would have to be 'toggling' I think as otherwise it is not possible to gain complete automation. Consider a light that has been switched (physically) off and then turns on via automation - the switch cannot be physically turned off, as it is already in that position.

This is why the conundrum exists and as such I would need to replace all switches with toggles, or distinct on/off buttons, so the family could easily manage.

However, they also need to work as non-smart/traditional lights if the network has failed, and I suspect this is a much harder problem to solve.

Re: Run Your Home on a Raspberry Pi

#276

Earlier quoted context omitted.

The starter for me was that my solar inverter (Fronious) wanted $199 per year for more than three days history, but exposed a very readable JSON over http interface. I had low watt PC handy (HP Microserver G7) doing nothing, so installed Home Assistant for long term tracking instead. After that, it kind of just snowballed.

I can't believe they would charge that amount for data. I was was pulling solar data in the past as well - pretty straightforward. To be fair it probably took you more time to set up but now that the work is done and maintenance is probably pretty low it should pay off after a couple of years. What other projects did you look into?

Replying to this twelve days later, but anyway...

$199 was a bit steep. If it was a one off, may be I just would have paid it, but since it's an annual fee, it's totally worth it.

Honestly, most of the solar / power tracking, graphing etc for home-assistant now works out the box[0][1]. I literally installed a plugin, and changed a few check boxes in the config. Not saying it's trivial for anybody, but for me it was. The real time data has proven invaluable in reducing power bills by knowing when we're importing or exporting power (1:3 price ratio here), and used that to load shift the expensive power users.

Since then I've added some temperature & humidity tracking to work out which rooms are letting the heat/cold in and out, done some basic automation to know when the washing machines and dryer out in the garage have finished, and a sensor to tell me when the garage door is opened or closed. I used a combination of BLE sensors and ZWave.

[0] https://www.home-assistant.io/blog/2021/08/04/home-energy-ma... [1] https://demo.home-assistant.io/#/energy

Post reply on HN