#mqtt text output
1 messages · Page 1 of 1 (latest)
I have found that having a space between the values at least improves the rendering.
Personally I'd suggest looking for a more human friendly version of those
They aren't specified by me and I don't necessarily know them beforehand.
that's what an enum is for, don't make text entities
Ah... well... that limits your options then
I can't make an enum if I don't know them beforehand, can I?
the enum says that you have to give all available values.
Wait those are states, not names of entities?
It is a translation of states from a bitmask.
so for instance, the "State" value for a solar inverter may have 10+ sates it is in (receiving solar, connected to grid, voltage is proper, etc, etc, etc)
Yeah, that's really really ugly and not very usable
This
Those text values are specified by the manufacturer of the equipment
You've got to think about how people could use those states... some binary sensors would be much more usable - one for connected to grid, etc
and if it isn't, then you shouldn't even bother creating an entity for this
that's also a good idea
but as I'm saying -- this is a generic protocol implementation where the data definition is specified by the manufacturer, not me -- I'm not even sure how I'd make those into binary states asides from creating a single entity for each named value coming in
do they specify linkages between the 2 topics?
if they do, then you'd use the list as your entities that will be generated
otherwise, if you don't want any of that, don't output the lists.
but what about proving the negative -- so lets say that OUTPUT_CONNECTED stops being reported. I can't necessarily know that I should make that entity a binary-false, because my app might be restarted and no longer have the state (and I'm not keeping track of state in the app, simply relaying the information)
At the very least you need to track that, so you can report it in a way that's useful to the end user
Simply passing the proverbial buck makes the result painful for the end user
They then have to parse the output and work out when you stop reporting something in that wall of text
That's ... pretty user unfriendly
Is there a way in the mqtt discovery payload to indicate that 'after no sign of this entity, auto delete it?' or something like that? I'm trying to think through the decision tree on how I keep track of state for entities that might be orphaned (storage failure?)
or rather, after-this-time, default-to-false
You can have it go unavailable though, from memory
they remain, but allow deletion depending on criteria