-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stateless properties #70
Comments
A simple way would be to use only the state of the relay . So you switch ("set") it to "ON", then the relay switches on (and publishes its status as "ON" on MQTT, so you get your feedback) and when it is switched off again after some seconds, just publish it as "OFF". |
Hey @mosseb, homie/garagedoor/motor/power/set ← "on"
homie/garagedoor/motor/power → "true" For your use case you can simply ignore the second topic and you are ready. @euphi @marvinroger @timpur is a stateless property something we should support in the convention, to be discovered as such? |
@ThomDietrich we could, but as you said, you dont have to listen to feedback. Do we need to add a special spec that just deals with this, i dont think so. i see no difference to fire and dont listen to feedback and fire and no feedback is sent. If there are reasons that im missing, that not sending feedback from the homie device has huge benefits, sure, but i dont see them? If your not interested in feedback then dont wait for it..... I think your examples solves this. its all about the naming of nodes and props to get the desired outcome. Seems this is about motor power not garage door open or close. |
@timpur the most important goal of the homie convention is to support automatic discovery of devices. Everything below that is just telling humans how they can set up and work with their devices but it's always subject to interpretation. |
From openhab's (ESH) point of view:
For a stateless property, you don't need the state. However, I strongly recommend to read back an Acknowledge that the command has been received. In my opinion, the current way to also use a normal Unfortunately it seems that there is no easy way in openhab to check the feedback. In my opinion this is a very important core feature of any automation system, so I will file a feature request against openhab - or Eclipse Smart Home. |
Regarding feedback of commands: I filed a feature request for ESH: eclipse-archived/smarthome#5309 |
Thanks for the answers. I'll try to apply those advices :) |
There is the property attribute "settable" that I'm using in my implementation for deciding if a channel is stateless. What else is necessary? |
settable is not related to wether or not a property is stateless. Not sure if you meant something else. |
True. It was late. |
Sounds correct to me 👍 Wdyt? |
What would a starless prop look like ? |
$stateless? ^^ |
I mean the layout of topics for a stateless prop an example ? |
@davidgraeff actually the affirmative rule for booleans would root for
That's it. Now we need to discuss details behind that. Is the topic retained? Is it still meaningful to make it settable? |
In a similar situation, a reset for a steppermotor I came to the conclusion that it isn't really stateless but that the change of state is very fast and that the state is changed by the client reset/pulse <- true (high) and then by the 'motor' reset/pulse -> false (low) |
@ThomDietrich I'm more wondering what the whole messages sequence from device to device would look like to you and the topics involved and how this is different from what it currently look like ? How do you send a state change? Through the same settable interface as we have now? |
In technical terms we are talking about the difference between states and events.
The handling of events is probably different to the handling of state changes, on both the controller and node side. An example for the controller side was given by @davidgraeff Now that I thought about it for a while I come to the following conclusion regarding Homie: Did I miss something? What do the others think? |
Exactly. Stateless means:
|
|
Should read: at least QoS 1. |
How can a stateless topic be not settable? Those are contradicting attributes aren't they? |
I have the slight feeling we have different understandings of "stateless". Especially as I know that you are googling towards ESH triggers...
|
@mosseb @euphi @timpur @marvinroger what do you guys think? |
Yeah thanks for clarifying. On the same page now :), yeah I think it does make sense. Just confirming is the on node or property level ? Assuming property? You can propose a PR, but honestly id like to enforce some sort of sign off on PRs. Like review and approval before merge. I think everyone should have a chance to discuss before it's pushed. We're defining a convention and we should make sure things are well thought out... Maybe @marvinroger you can enable branch protection feature of github ? |
Personally I'm interested in the "stateless + non-settable" combination, because I would like to create (DIY, of course) some multimedia remote controls based on Homie. Something similar to this, but with a ESP8266. The remote control doesn't need to store anything or know nothing about the controller side (openHAB in my case, but it doesn't mind), that's why the property should be stateless. I could use a standard property and model the button presses with the "/set" topic, ignoring the state topic, but modelling it natively in Homie would be ideal. But I don't know what is the best implementation 🤔 |
I also think this combination could be quite interesting for many. Regarding your implementation: I'd suggest to open a new issue and I'm sure someone will jump in and give you an idea. |
Hi. Have a good day ! |
Well I reread the thread and this seems to be the exact same conclusion for @davidgraeff and @ThomDietrich right ? :) |
Yup. The convention should contain the "stateful" attribute. I'm accepting this property in the new mqtt openHAB binding, to be released with 2.4. |
Because I'm diverging from the convention already to cover all use-cases I have created a PR to cover the stateful attribute. #108 |
@ThomDietrich, @timpur Please have a look. This is kind of urgent. Another user mentioned in the PR that this flag should just be called "retained", which also absolutely makes sense. |
After re-reading the thread, it seems like @ThomDietrich made the clearest distinction of this functionality by differentiating state from event. The settable attribute is already in the specification, so if you don't want it settable, then make it so. The only thing left is to advertise this as an event, which I feel MQTT has already addressed using the retained terminology. As the maintainer of a NodeJS implementation of Homie, I have an interest in Homie not being confusing. I feel that declaring an attribute as Retained as well as Settable solves all use cases in this thread, and doesn't introduce new terminology. |
Stateful and stateless are more meaningful from a non-mqtt perspective and it can be helpful for library users (@lorenwest's NodeJS, homie-python...), because they don't need to be MQTT experts to understand and use the library. What do you think? Anyway, I'm fine with the retained option, it feels a straightforward word, even if it sounds too mqtt-centrict. Many thanks for your opinions and keep up with the good job! |
Introduce the "retained" flag for properties to express "event"-like, stateless properties. Closes homieiot#70.
Introduce the "retained" flag for properties to express "event"-like, stateless properties. Closes homieiot#70.
Hi,
I'm starting to play with homie (and in particular the esp8266 implementation) and I have a very simple use case which i'm not sure how to do.
My garage door motor is a simple one, where I have a simple contact. I wired a relay on my motor, which is in turned driven by the ESP8266 I/Os. Was the relay is closed, the garage door starts to move. So my program currently just receives an MQTT message, and put the relay "on" for some seconds. I'm not able to choose if it will go up, go down, unable to send any smarter command.
So far so good.
I wish to convert my simple but not satisfactory LUA code to C++ using homie and platformio.
How should I configure this node to have a simple "rising edge" button with no state, but just an isolated order ?
Seems like a node with a switch property is not correct, because it would have an "on" and "off" state but mine is stateless.
Thanks for your opinion.
Regards.
The text was updated successfully, but these errors were encountered: