Making my dumb A/C smart with Elixir and Nerves
milanvit.net
milanvit.net
Erlang, Elixir, and the BEAM are super cool space tech for sure, and are also overkill sometimes. For example, for a simple LAN service where a minimalist solution will get the entire job done in 20-30 minutes (or in the case of TFA, a few hours).
I want to coordinate two thermostats that are on a zoned system, and I have a lot of things I want to do, but the first thing is I want to replace the automatic fan with something more specific, and I can't figure out how to get started:
If zone 1 is off (or fan) and zone 2 has had the fan run less than 30 minutes in the last 60, and less than 8 hours in the last 24, run the fan.
But I can't figure out how to write a homeassistant helper that gets recent runtime.
Eventually, I'll probably just write some Erlang to poll HomeAssistant (since HomeAssistant knows how to poll the thermostat with HomeKit, and HomeKit is otherwise inscrutable).
This will do it (though it'll require some learning and trial & error, like any worthwhile automation platform, be it HA, HomeSeer, etc).
https://community.home-assistant.io/t/home-assistant-communi...
I stupidly programmed my entire garage door auto-closer in Node Red over the course of half a day, before realizing they all come with this functionality (to be fair, my fancy automation takes the motion sensor into account so it won't close while someone is actively in the space).
Node Red is great because you can fall back to writing Javascript functions once you learn how to setup and debug event workflows.
This might get you started:
https://www.google.com/search?q=home+assistant+time+since+la...
Here's one example: https://community.home-assistant.io/t/show-time-since-last-s...
Here's another: https://community.home-assistant.io/t/get-difference-from-no...
Hope this helps!
I believe the "how long since a state change" only starts counting from the state change and within the same session. If the server restarts, the counter stops and will restart from scratch only from the next state change.
This means if an automation relies on such timers to reset itself back to its idle state, a server restart will forever leave it in that state.
Automations are nice for quick one-off actions but for anything that lasts more than a few seconds I'd suggest looking for alternatives. Something as complex as managing multiple devices with interdependent states is way too complex and is bound to go wrong even if you actually manage to express it in an automation (and don't give up because of the absolutely awful automation editor UI).
Home Assistant is great as a proxy/aggregator to connect many different devices/protocols and expose them under a single, consistent API, but it's terrible at logic. For any kind of complex task I'd suggest making a stand-alone app that interacts with the Home Assistant API to observe device states and control them.
There are recycled mining rig space heaters (that may or may not need Internet access to keep heating), pool heating immersion mining rigs, and probably also water heaters with temperature stats that might be useful in a smart home interface instead of something like Grafana.
Less overkill in what way? file size, speed, dev-time, other?
People are of course free to spend their time as they wish, but I'd rather solve it efficiently and move on to things I find more interesting and challenging. "Good enough" is great.
Same with lights. If needed, I turn them on when I enter a room. I turn them off when I leave.
In my car I can't stand "automatic" climate control. It never works properly. The best system is one manual dial for fan speed and one dial or slider for heat with an on/off for AC. Simple, reliable, and adaptable to conditions that are outside the parameters of the automatic sensors and programming.
https://partofthething.com/thoughts/controlling-a-fujitsu-he...
If you're using verbs like "to trod" you could do better.
Also, all of the jerks here who want to say you should have used their tech stacks should STFU.