Hi, new user here

Hi everyone,

I’m Paul from Northern Ireland. A Software Engineer by trade. I have written my own heating automation system in Python. It’s multi-zone, presence aware, layered schedules, demand based and logs to RRDs and display with Cacti.

I had a short spell at “the other forum”, but when I mentioned I wrote my own heating control system, fanboyism took hold and to cut a long story short, stones started to fly and I was told that I accept their software or leave. So I left. I hate fanboyism.

So why am I here if I have my own system? Well, I have my own heating system, which I’m happy to share, but there is more to home automation than heating. There are also layers to these systems that I am not so great with, such as UIs and integration with proprietary APIs.

I prefer to go down close to the metal and build automatons from scratch where possible. If something is either ON or OFF then I would ultimately like to boil that down to where I have a boolean True/False value for it that I control. I can then build the intelligence on top of that. Being able to turn a lamp (etc.) on from my phone does not impress me, that is just a remote control, it’s not smart, it’s dumb, there has to be be more.

Luckily I have both software and electronics experience and am not afraid of some low level bit banging in C++ or at the same time, writing high level abstractions in Python, or if provoked Java.

I think the first thing I want to look into HomeAssistant for is as a control UI to manage configuration and profile values for my heating system and provide an easier way to alter things like target temps. Also a means to envoke overrides on the system by raising manual demands.

The thing is these integration layers don’t quite exist yet in my system. Demand overrides exist by publishing JSON to a UDP socket, but control over config and target temps doesn’t. At present I am thinking of adding some form of Python REST API mechanism onto the main data hub and working from there.

So I should probably start by looking into Home assistant UDP, REST integrations and would love pointers to the best place to start for these. So far I have only really found “TCP Sensor” and “Binary Sensor”, but I am hoping there are REST integrations too.

It will be struggle at first so bear with me.

Paul

Hey, good to have you on board.

If you want a quick and dirty way to get from HASS to your app, mqtt might be a quick way.

I suspect they already have python library’s and it makes it usable by others, not just HASS

(Please note I’m not a coder, I just find guides and adapt them to what I wanna do)

MQTT is an interesting option for some things. Demand overrides, yes. I can receive an MQTT message and publish the demand using that. Not sure about it for UI hooks. Suppose I need to start poking around and find out how things work first.

Surely REST is a fairly standard protocol. Without knowing how things actually work I would imagine HASS holds a value about something (like “Living Room Eco Target Temperature” and if I change it via a UI it generates a REST call to update the heating system and possibly vice versa, if the heating system updates the value, occasional polling of the value via REST displays it on the UI.

By the way, I do like the “open ended” features I am seeing with letting developers of integrations execute shell commands and (I would assume, though haven’t seen directly) execute python code directly. That’s appealing.

Hello and welcome,
I “assume” your other forum had “hab” in the title?
Don’t worry, we just don’t care and love a good argument especially if we learn something from it.
You seem like you’ll be teaching us before too long, so please bear with US!
Cheers
Mutt

I saw your thread on the openHAB forum and I’m afraid, but you’ll probably hear the same things here from the experts.

You said you have your own system, why reinvent the wheel? You have any concerns about performance?
Home Assistant is supposed to be used by everyone, if I understood you correctly, your system is adapted to your needs and does exactly what you want, and only what you want. Like this you are doing a one-man show and you will spend enormous amount of time to recreate stuff that is already existing.

Check out the RESTful sensor

You said you like or are used to python. Take a look at AppDaemon then, it allows you to do automations for Home Assistant completely in Python.
https://appdaemon.readthedocs.io/en/latest/

If you think your own system could be useful for other users, you may try your hand at build a custom_component for HA. Another option should be using appdaemon to write your automations. If you still want to keep things apart, I would avoid UDP.

If you are an expert in hammers, you will tend to hit screws with hammers and claim it works fine.

Look out your window. How many different types and designs of wheel do you see?

Would you fit a 13" steel rim to a Formula One car or a semi truck?

This is, I think were the main problem came from in that other thread. This attitude that there can only be ONE system and that system must rule everything and everything home automation must obey and conform to the design set out by the holy lords our developers.

In my opinion, “One design to rule them all” is “tool orientated design” and a classic “design fallacy”.

“Though shalt not question our lords who have decreed how our homes are automated! Blasphemy! Stone him!”

The irony is there is not one system. These high level “engines” like OH and HASS usually control and integrate many systems.

Let’s just consider my system one of those. I have not created a competitor or replacement for OH or HASS. I have developed a heating system (that can technically do other things). It can be considered a compliment to rather than a replacement for.

I know it’s maybe hard for non-developers to fathom this, but there are other alternatives to buying an off the shelf systems and then using HASS to integrate them. If you don’t like Nest or EvoHome or whatever proprietary product, then you could actually make one yourself and use HASS to integrate that sub-system with others.

Does that at least go some way to put that contention to bed?

1 Like

I don’t think there will be any contention and people will be keen for you to share.

There’s hundreds of ways to get the result and everyone will approach it differently.

Have fun; share your stuff; you’ll have a great time here and find a great community. We all approach things differently, get ideas and help each other over the bumps. No idea about your openhab experience but I suspect its different here.

Welcome anyway.

1 Like

Yes, they all have different design and some designs are better for some purposes, but in the end of the day, all of them are round.

In this case your heating automation would be a custom component. There’s no built-in heating component, you choose yourself which components you want and which you don’t. See home assistant as the orchestrator that connects all the different components you use.

I use DIY hardware myself. You can do exactly this with home assistant, write your sub-system and integrate it as a custom component.

Don’t wanna be offensive, but it seems to me that you don’t understand how home assistant works.

That’s not offensive, it’s accurate and fair.

I want to learn. If it turns out that HASS won’t do the things I need, I hope I can still hang around as there are a lot of experienced automation folks who I can learn from, even if I am doing things DIY.

1 Like

Can you explain exactly what you want to do? (English is not my native language, maybe I’m just too dumb to understand your request from the initial post) I’m almost sure there is a way to do what you want with home assistant, in my opinion it’s an exremly flexible system that can be afopted to almost everything.

There are an enormous amount of DIY hardware and software projects for home assistant.

Welcome Paul,

I built my own thermostat devices and “just” use HA as a web front end to control e.g. target temperatures and display nice temperature graphs. The complete interfacing is done via MQTT.
If HA or MQTT goes down, the thermostats remain working independently since all of the control logic is built into them.

Your use case seems to be similar, if not please correct me.

Regards
Dominik

By the way, welcome to the forum! :grinning:
I’m sure you’ll be a huge profit for this forum and there’ll probably a lot we can learn from an experienced developer like you.

1 Like

What I hope to do, maybe this evening, maybe tomorrow morning, is create a post on how I automate heating and provide code to that end if anyone wants to try similar or adapt my code to work for them.

As to what your question is actually about.

My system is basically a black box. The only ways I have to communicate with it are via the button on the heating relay or looking at graphs in Cacti. Like this one for example:


(Green shading is “presence”, Blue is heating ON)

I “can” technically issue a manual demand with something like:
echo "{“key”: “heatingLivingroom”, “expiry”:“3600”, “demandState”: “ON”} | nc -u 10.0.0.3 9996
or similar. But that’s a bit “too” clunky even for me.

I can also see what schedules have demanded what by looking at the logs over Putty, but again clunky.

Target temperture profiles are currently hardcoded and I am finding already that this does not provide enough flexibility, so I want to expose those out to be managed, so they can be tinkered with from a UI to suit my current requirements day to day as they change a bit.

Yep this is close to what I am after. We might go about it slightly differently, but the idea is the same.

I would suggest using a standard for IOT devices. MQTT is a standard in the IOT world.

This looks pretty cool.

I assume it’s kinda “read only” as it’s sensor.

What mechanism does HAss use to push data or command actions? Actually I think this is probably too basic a question and I should go RTFM and play over the weekend. :slight_smile:

1 Like

You can easily issue shell commands from home assistant and from AppDaemon as well
You could get the key, expiry and demandState from the UI, with an input slider for the expiry, an input select for the key and for the demandState.
I’d suggest that you install home assistant and AppDaemon and get a bit familiar with them.