-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[shelly] FTR: Control Auto-ON when setting Dimmer brightness #6608
Comments
Comment: maybe a change in terminology would clarify? openHAB's simple Dimmer Item model does not sit comfortably with the suggestion. It has only a single state, a percentage, so if it is "off" it can only be off i.e. 0% Real world dimmers like Shelly can have more complex behaviour - such as responding to an "on" command by resuming a previous dimmer %. Other designs behave differently, e.g. come on at minimum brightness, or full brightness, or some specially designated preset value - so we cannot make assumptions at the generalized openHAB end. It seems to me this request could be reworded as looking for a "preset" channel - a % value that can be written to, without affecting actual current state. This preset channel could optionally follow any % changes on the "real" state channel to give a memory/resume effect. |
Yeah sounds good. Shelly dimmers can be adjusted at the switch. If you hold down the switch. So the "preset" item would idealy show current configured brightness on Shelly device. With your suggestion.. I could create two items When brightness is adjusted at hardware end preset item should update |
I'm confused The current implementation allows to
There is no need for a preset value. You could have 2 separate items mapping to the same brightness channel (Switch + Number) - this is verified. The binding acts differently based on the value type send to the channel. From my understanding the binding is following the OH paradigm for DimmableLight. So I don't get the need for an extra channel (which I had to remove). |
I have described a use case above. I would like to be able to set my kids lights to 10% at 9pm. Regardless of the light state. I currently use mqtt with shellys and have this working perfectly. But binding doesn't support this. So if light has been set less than 10% then I don't adjust brightness. Thanks in advance. :) |
Also brightness value is nulled if light is turned off. |
You usecase would need a complete redesign of the dimmableLight semantics in openHAB. But you can achieve this right know by using proxy items for your dimmer while using the Shelly binding. |
thanks heaps for your time to read and respond. :) I had a look through the code a bit. Im no expert and have never used Java before. If below was changed to remove turn on state Like here: How I have this working now is seperate switch and brightness item. `private void handleBrightness(Command command, Integer index) throws IOException {
Im still yet to figure out how the brightness received is being managed. Reason im really keen to uses shelly binding - is I am able to re-enable cloud setting on the shellys so that I can store power usage in their cloud solution and use their app to view and filter the data. But I could just build something and continue with mqtt - but cloud power monitoring is very tempting. But fully understand if what I am suggesting is a workaround - or a hack. If your still a hard no on this then I will close it. I will find another option to visualise power data or try figure out how to compile my changes :) Thanks in advance. |
Your suggested changes will not work, as setting a brightness value of zero would not switch the device off. If I undertand your suggestions right, sending a value >0 to a switched off device would not turn it's state to on. This behavior is not compliant to openHABs semantic of a dimmableLight. |
Okay thanks for your time. |
@VanadiumJade I thought about you use case and @hmerk comment about "conforming to the UH paradigm". In fact triggering 2 actions on a single command is not a very clean approach. Doing the Auto-ON for the Dimmer might be more convenient for the user (only 1 action), but also intransparent, because it does "something" more. The "inconvenience" could be easily compensated by a rule. Addressing both views I'll integrate a new thing config option: brightnessAutoOn With this both use cases could be achieved and I keep backward compatibility. What do you think? |
That would be perfect! Also thanks heaps for taking a further ponder over my request. |
try this build: |
Thanks - sorry I was late responding - Christmas time. I tried the snapshot jar - but I get below error. also github for some reason isn't tagging the log properly... but its all below `2019-12-26 22:12:36.898 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.shelly-2.5.0-SNAPSHOT.jar
` |
you need to manually install coap, enter the following at karaf console |
Okay, I have it working now. Is there anyway to see the brightness that is set on shelly even when the light is off? Is anything cool at your end you could do in this situation. I always want to see the dimmer value even if the light is off. otherwise if openhab lets me... I could add a rule to stop the dimmer update from happening if then new state is going to be null. |
ok, the change will then be part of #6592
No, when the dimmer is off the binding has to report 0 as value |
Awesome. Will this request be updated when other request is complete? Just so I know when I can update Shelly binding. 😃 One more question. I'm running a VM with openhab in docker. When Shelly binding updates Shelly devices output API it's putting 172.x.x.x instead of actual 192.x.x.x IP. Is this a bug in binding? Or expected behavior when running openhab in docker? |
You could watch the PR: #6764 |
Please post questions in the community thread https://community.openhab.org/t/shelly-binding |
openhab#6560, openhab#6608; update lastUpdated channel only when another value changed; thing status messages translated to German (COMM_ERROR/CONF_ERRORs) Signed-off-by: Markus Michels <markus7017@gmail.com>
Shelly Dimmer:
Thing has combined controls for brightness and power state.
Current state
if you set brightness when light is off - then light will turn on to desired brightness.
You cant see what brightness value while light is off.
Feature
New Feature use case
Rules can run to adjust desired brightness reguardless of state.
I can set children room brightness to 50% after 7pm and 10% after 9pm.
I can see if lounge brightness is < 10% after 8am and set to 100%.
Currently I will turn on my kids lights if I try adjust the brightness.
I have got this working correctly with MQTT but would love to move to shelly binding.
Your Environment
Openhab 2.5RC1
Docker image openhab/openhab:2.5RC1
Dell power edge r710 server / vmware / ubuntu / docker
The text was updated successfully, but these errors were encountered: