Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
Sure.
My setup here is pretty simple: a handful of temp/humidity sensors that push their readings to an MQTT queue, which then is read by Telegraf an written to InfluxDB. Optional complexity: I would prefer these sensors to delay the acutal send events, so they can push a batch of readings in one go.
Now, ideally HA would be able to read the data from Influx as a sensor and even import the history. I tried the Influx integration, was told to configure that in the config files and literally for days I tried to get everything to work, but it just would not work. I can't even list the different error messages here, it's been a few weeks, but the consensus seems to be, that Influx is essentially not readable for HA for reasons. Like, there's no error message that I could make sense of, it's just generalFuckYouError 5446.
Ok, then maybe I can read the measuements directly from MQTT? I would have duplicated data, but I can always delete old data in HA, so that's ok. All my sensors currently write in the same topic and each message contains the sensor name, a timestamp and two measurements. That data structure however is utterly unreadable in for HA. Obviously, I need to split the messages into different (HA-)sensors based on the sensor name field and then differentiate between the different sensor values (humidity/temp). That is not possible. Like, it is completely not supported and the official stance is to put a bunch of MQTT listeners for each sensor/value pair in your config and then filter the messages based on sensor name and reading. Well, that's really convenient! Especially for the completely outlandish case, that someone might want to automatically add new sensors.
But ok, I played ball. I set up two testsensors (so four listeners in total). And it kind of worked. Until I noticed, that each message is processed once, which is perfectly in line with MQTT semantics, but it meant that messages that didn't fit the listener they happened to collide with were just dropped. Awesome!
But ok, next try, I've got Telegraf, that thing can probably help out. So I created new topics for each sensor and value, in a nice hierarchy and created a bunch of HA listeners, each having its very own topic.
And that finally kind of worked. I still can't batch-import messages, because HA ignores MQTT timestamps, I still can't dynamically add new sensors, I still can't "fuse" sensors belonging together (hum/temp do kind of correlate, after all), etc. etc.
My case isn't really unusual and not really complicated, yet it took me literally weeks to get to this point and it's still a clunky, semi-functional clusterfuck, whos only benefit compared to Influx is, that it has an Android app.
Disclaimer: I might mixed some thing up in the description above, it's been a while. And I'm certain I could make some things nicer, but that's not the point. I'm a senior software developer and can't get this pile of Python to run. Maybe I'm really stupid, but I'd say HA is the culprit here.
You spent four paragraphs describing your unusual and unique set up and then asserted that your setup isn't actual either of those things. I think you just don't realize how out of the norm your requirements are.
What exactly?
Seriously, reading data from Influx isn't unusual, it's kind of the whole point of a database to be read from. And sensor data kind of represent a time series. There even is an official plugin, it just doesn't work right.
What you seem to conveniently ignore is that I'm starting at two very simple points. And all those paragraphs are just attempts to make one of those work. That's it.
And again, this is exactly the attitude I'm referring to. Oh that is totally weird. That can't work, obviously!
Why? Why does the very simple use case to read data from a db not work?
Looks like an user error to me. Influx is for long-term storage of history and data, you don't need it for automation at all.
Looks like this is not up to you to decide.
If you would have read my comment, you would have noticed, that I intend to use Influx as a long term DB and use HA as automation around that. BTW: The thinking you're showing here is exactly what I'm criticizing. You think that DBs and automation have no connection, so you decide, that I am the idiot for even trying. This is literally what I've described above.
Also, I wrote quite a paragraph about the fact that I already accepted the idea to ditch the direct Influx integration.
So you use the free thing wrong, don't RTFM, vent on internet and then vent some more when corrected? What's your end game?
Nobody corrected me at all. It's just "yeah because u stoopid".
I did read the manual. I did search for solutions and tried different approaches. And I documented that above. You seem to ignore that.
Why do I vent here? Because that's the question of the fucking post! Read the post! That's exactly the question.
Why do you have to be so stubborn? Can't your accept, that maybe, just maybe, HA isn't directly sent from God? Is HA your religion? Does that religion prescribe only skimming comments and just reacting on keywords to rile yourself up?
Seriously, this pointless, self-righteous arrogance is the reason so many people hate "nerds". This entire thread here is basically the "well ackshually" meme in text form. Reflect a bit in what you're doing here.
Thanks for elaborating. While I think that is a far cry from "some very basic features" being "utterly impossible", I see the point, but I disagree that this a common experience.
HA is meant as the central point in home automation, meaning it is consuming sensor data, automating actors and showing everything on its dashboards. Following that philosophy, long term storage is meant to be written to by HA, but not consumed from there.
Then you are also running a very non-standard MQTT setup that does not conform to the usual conventions. If it were, you could make use of the autodetection capabilities and make sensors (and actors!) work very easily with HA/MQTT. I played around with this myself in a little toy project which I use to control my linux machine via MQTT and this worked wonderfully.
I'd argue you are very far away from a typical use case and naturally you will run into problems making it work. That's FOSS software for you, you can try to work around it, you can work on the missing features yourself or you can leave it. But it's not fair to pretend your very special use case is some kind of measure of the project's quality. People have built amazing things with HA, far from "exactly the path someone had in mind".