Skip to content
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

HABridge sometimes executes both "on" and "dim" command #923

Closed
heikoh81 opened this issue Mar 14, 2018 · 39 comments · Fixed by #1085
Closed

HABridge sometimes executes both "on" and "dim" command #923

heikoh81 opened this issue Mar 14, 2018 · 39 comments · Fixed by #1085

Comments

@heikoh81
Copy link

heikoh81 commented Mar 14, 2018

Hi,

with 5.2.0 RC23 and 5.2.0 Final I noticed that sometimes, not always, HABridge executes both the on AND the dim command.
I just do simple URL Calls with HA Bridge. I noticed double log entries in my FHEM system when using Alexa and started investigating.
I narrowed it down to HA Bridge devices that both have a on command and a dim command.

I'm not sure if the problem is with Alexa or HA Bridge, though.

This is what fhem is logging:
2018-03-14_17:37:02 AlexaSonnenschutzWohnzimmerTuer on 2018-03-14_17:37:03 AlexaSonnenschutzWohnzimmerTuer 100 2018-03-14_17:37:23 AlexaSonnenschutzWohnzimmerTuer on 2018-03-14_17:37:42 AlexaLichtSchlafzimmerBett off 2018-03-14_18:22:34 AlexaLichtStudio on 2018-03-14_18:22:34 AlexaLichtStudio 100 2018-03-14_18:40:51 AlexaKamerasInnen off 2018-03-14_18:41:38 AlexaDreamboxStudio on 2018-03-14_18:41:38 AlexaDreamboxStudio 50 2018-03-14_18:43:49 AlexaFernsehenEssecke on 2018-03-14_18:49:32 AlexaLichtCouch on 2018-03-14_18:49:32 AlexaLichtCouch 100 2018-03-14_18:53:55 AlexaLichtCouch off 2018-03-14_20:23:41 AlexaFernsehenEssecke off 2018-03-14_20:24:26 AlexaHeizstrahler on 2018-03-14_20:24:26 AlexaHeizstrahler 100 2018-03-14_20:25:17 AlexaLichtStudio off

As you can see, some time entries are double; on and the dim command for 100 percent.

Sample entry for Heizstrahler:
Type = HTTP Device
Target Item = http:https://192.168.178.230:58083/fhem?cmd=set%20AlexaHeizstrahler%20on
HTTP Verb = Get
Content Type = Text/HTML

Dim Item:
http:https://192.168.178.230:58083/fhem?cmd=set%20AlexaHeizstrahler%20${intensity.percent}

Greetings from Germany,
Heiko

@bwssytems
Copy link
Owner

Yes, this will occur when the ha-bridge receives a call that as both on and dim in the hue api request. If you do not want this to behave this way, select the on first dim in the device edit tab.

@bwssytems
Copy link
Owner

Did this answer your question?

@heikoh81
Copy link
Author

heikoh81 commented Mar 18, 2018

I can try it for testing.
Didn't know this Option exists.
Is this behaviour new? Did not notice it on Versions < 5.2.0 Final.
What would I have to do to make it behave the old way:
Alexa, turn XY on => on-command
Alexa, turn XY to 50 percent => dim command
Alexa, turn XY off => off-command

@bwssytems
Copy link
Owner

Set the device to "On First Dim" and that will do what you want.

@heikoh81
Copy link
Author

heikoh81 commented Mar 19, 2018

No, I can't get the old behaviour back!
If I set "On With First Dim" to True, HA Bridge sometimes sends the off command although I said "Alexa, turn Lights to 50%". Only with this option = false, I can get it to work with the percentage.
However, then it always sends the on command first.

I use HA Bridge only as a bridge for Alexa, I don't need and don't want to have it any logic off its own, like on/off state.
If I say: Alexa, turn Light off, I need it to send the off command, indepent of what HA Bridge "thinks".
If I say: Alexa, turn Light to 50%, I need to send it the 50% command, without an "on"-command before that.

I have built quite some logic around this in FHEM, e.g. if I say "Alexa, turn Sat Receiver to 50%", it turns my Enigma-Receiver on and puts it to standby after some time. Otherwise I can't use this receiver with Kodi. All the logic is done in FHEM, not in HA Bridge!

Also, I like to point out that it would be much better to implement new options as optional and not to be enabled by default on an existing installation. Now I have to manually update 124 HA Bridge devices!

@bwssytems
Copy link
Owner

I do have a question: What system is calling the ha-bridge where you get this behavior? Alsom the payload would contain both an "on" and a "bri" command to get the behavior you are having.

@heikoh81
Copy link
Author

I don't understand your question.

I am using various Echos to call HA Bridge? This behaviour is produced by every Echo I use (Show, Echo Dot, Echo).

I don't understand the second sentence?
In my first post, I descriped that I simply do URL-Calls with HA Bridge...

@bwssytems
Copy link
Owner

turn on debug for the HueMulator class and post your log

@heikoh81
Copy link
Author

heikoh81 commented Mar 19, 2018

On it.
I'm on 5.2.0, though.

@heikoh81
Copy link
Author

heikoh81 commented Mar 19, 2018

This is the log for: on, then off, then 50%.
50% was sent to FHEM with on-command only.
On with first dim = True.

Mar 19 21:23:04 raspcam6 java[8149]: 2018-03-19 21:23:04,505 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60/state>>>, and body <<<{"on": true}>>> Mar 19 21:23:04 raspcam6 rsyslogd-2007: action 'action 19' suspended, next retry is Mon Mar 19 21:24:34 2018 [try http:https://www.rsyslog.com/e/2007 ] Mar 19 21:23:04 raspcam6 java[8149]: 2018-03-19 21:23:04,510 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue state change requested: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 body: {"on": true} Mar 19 21:23:04 raspcam6 java[8149]: 2018-03-19 21:23:04,511 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling on-off as requested. Mar 19 21:23:04 raspcam6 java[8149]: 2018-03-19 21:23:04,511 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20on","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:23:04 raspcam6 java[8149]: 2018-03-19 21:23:04,512 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:23:06 raspcam6 java[8149]: 2018-03-19 21:23:06,065 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:23:06 raspcam6 java[8149]: 2018-03-19 21:23:06,067 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:23:06 raspcam6 java[8149]: 2018-03-19 21:23:06,068 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,114 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60/state>>>, and body <<<{"on": false}>>> Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,116 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue state change requested: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 body: {"on": false} Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,117 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling on-off as requested. Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,118 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20off","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,119 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,341 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,345 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:23:29 raspcam6 java[8149]: 2018-03-19 21:23:29,346 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,222 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,224 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,225 [qtp11012069-233] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,322 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60/state>>>, and body <<<{"on": true,"bri":127}>>> Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,324 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue state change requested: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 body: {"on": true,"bri":127} Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,325 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling on-off as requested. Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,325 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20on","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,326 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,635 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,637 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:23:59 raspcam6 java[8149]: 2018-03-19 21:23:59,638 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch

@heikoh81
Copy link
Author

heikoh81 commented Mar 19, 2018

On with first dim = False.
Voice Commands: off, then 50%.
It was received with off, on then 50% by FHEM.

Mar 19 21:26:42 raspcam6 java[8149]: 2018-03-19 21:26:42,801 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/devices/backup/available>>>, and body <<<>>> Mar 19 21:26:42 raspcam6 rsyslogd-2007: action 'action 19' suspended, next retry is Mon Mar 19 21:28:12 2018 [try http:https://www.rsyslog.com/e/2007 ] Mar 19 21:26:42 raspcam6 java[8149]: 2018-03-19 21:26:42,801 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/devices>>>, and body <<<>>> Mar 19 21:28:41 raspcam6 java[8149]: 2018-03-19 21:28:41,255 [qtp11012069-235] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/devices/60>>>, and body <<<{"id":"60","uniqueid":"00:17:88:5E:D3:3C-3C","name":"Licht Couch","mapId":"2-copy-copy-copy-copy","mapType":"cmdDevice","deviceType":"custom","targetDevice":"Encapsulated","offUrl":"[{\"item\":\"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20off\",\"type\":\"httpDevice\",\"httpVerb\":\"GET\",\"contentType\":\"text/html\"}]","dimUrl":"[{\"item\":\"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20${intensity.percent}\",\"type\":\"httpDevice\",\"httpVerb\":\"GET\",\"contentType\":\"text/html\"}]","onUrl":"[{\"item\":\"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20on\",\"type\":\"httpDevice\",\"httpVerb\":\"GET\",\"contentType\":\"text/html\"}]","inactive":false,"noState":false,"offState":false,"deviceState":{"on":true,"bri":127,"alert":"none","reachable":true},"onFirstDim":false}>>> Mar 19 21:28:41 raspcam6 rsyslogd-2007: action 'action 19' suspended, next retry is Mon Mar 19 21:30:11 2018 [try http:https://www.rsyslog.com/e/2007 ] Mar 19 21:28:41 raspcam6 java[8149]: 2018-03-19 21:28:41,439 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/devices>>>, and body <<<>>> Mar 19 21:28:41 raspcam6 java[8149]: 2018-03-19 21:28:41,442 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/devices/backup/available>>>, and body <<<>>> Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,142 [qtp11012069-232] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60/state>>>, and body <<<{"on": false}>>> Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,144 [qtp11012069-232] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue state change requested: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 body: {"on": false} Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,145 [qtp11012069-232] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling on-off as requested. Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,146 [qtp11012069-232] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20off","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,146 [qtp11012069-232] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,620 [qtp11012069-231] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,622 [qtp11012069-231] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:28:49 raspcam6 java[8149]: 2018-03-19 21:28:49,623 [qtp11012069-231] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,111 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,114 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,114 [qtp11012069-176] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,200 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator PUT called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60/state>>>, and body <<<{"on": true,"bri":127}>>> Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,201 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue state change requested: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 body: {"on": true,"bri":127} Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,202 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling on-off as requested. Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,203 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20on","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,204 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:28:56 raspcam6 java[8149]: 2018-03-19 21:28:56,370 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling dim as requested. Mar 19 21:28:57 raspcam6 java[8149]: 2018-03-19 21:28:57,021 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Decode Json for url items: [{"item":"http:https://username:[email protected]:58083/fhem?cmd=set%20AlexaLichtCouch%20${intensity.percent}","type":"httpDevice","httpVerb":"GET","contentType":"text/html"}] Mar 19 21:28:57 raspcam6 java[8149]: 2018-03-19 21:28:57,023 [qtp11012069-229] DEBUG com.bwssystems.HABridge.hue.HueMulator - Calling Home device handler for type : httpDevice Mar 19 21:28:58 raspcam6 java[8149]: 2018-03-19 21:28:58,121 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - HueMulator GET called on api/* with request <<</api/hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT/lights/60>>>, and body <<<>>> Mar 19 21:28:58 raspcam6 java[8149]: 2018-03-19 21:28:58,123 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - hue light requested: 60 for user: hvfbYuUan9QfFarnCA5OS7jUt0ws0znGb0N27gzT from 192.168.178.186 Mar 19 21:28:58 raspcam6 java[8149]: 2018-03-19 21:28:58,124 [qtp11012069-237] DEBUG com.bwssystems.HABridge.hue.HueMulator - found device named: Licht Couch

@bwssytems
Copy link
Owner

This is the new behavior as expected as it sends the on, to turn the device on and then sends the dim. I would have to add a new setting to treat the request containing both to only execute the dim portion.

@heikoh81
Copy link
Author

heikoh81 commented Mar 19, 2018

YES, PLEASE. THIS IS NEEDED!!!!
Another example: I have shutter blind actuators that always know there position internally (Homematic).
If I say: Alexa, turn blinds to 50%, and HA Bridge would send "on, then 50%", this would mean that for a short period of time my actuator would send the on command, then maybe the other direction. Consequently, this would mean a lot of stress both for my actuators and my shutter blind engines! The engine would switch from one direction to the other within a second. Can you understand what I'm trying to say? This would mean much shorter product life for both actuators and engines!

@heikoh81
Copy link
Author

Is this new Alexa behaviour to send "on then dim" or is this just HA Bridge internal.
It was not a problem with 5.2.0 Release candidates...

@heikoh81
Copy link
Author

Also, I'd like to offer my support in testing with RCs if you implement this feature.
Can you guess a timeline?

@bwssytems
Copy link
Owner

It may be both, I remember in the beginning that Alexa was only sending the dim portion when I tested. And I see now that you are getting the on and dim together. The ha-bridge was changed in 5.0.0 to send both as other systems needed the on to be sent before the dim command would take effect.

@heikoh81
Copy link
Author

Yes, I understand that some Systems might Need it.
In my System, it would be contra productive.

It would be very much appreciated if you add the Checkbox as described above to just execute
on
off
dim

Can you implement this?

@bwssytems
Copy link
Owner

Will put this in the enhancement list

@audiofreak9
Copy link
Collaborator

@bwssytems I would like this feature too, some of my X10 devices remember their state internally just like @heikoh81 blinds. An ON command, instead of DIM command, would only turn them on at their memory state. Thanks!

@heikoh81
Copy link
Author

Is there some Progress on this issue?
I'd like to test a RC if available.

@bwssytems
Copy link
Owner

Nope, taking a breather.... maybe in a couple of weeks

@tuicemen
Copy link

tuicemen commented Apr 4, 2018

I'd like to expand on this. I like @audiofreak9 use X10. Devices that remember there last state if dimmed down to 100% think they're on. The option to send a off prior to dim would be beneficial in cases like this.

@bwssytems
Copy link
Owner

I'll take a look at this, was trying to be more efficient in operating on what the command sent would achieve.

@bwssytems
Copy link
Owner

I think I will add another flag that will override using on when there is a dim present. This will be overridden by onFirstDim if checked.

@heikoh81
Copy link
Author

This would be very nice.
Feature still needed even after half a year...

@bwssytems
Copy link
Owner

bwssytems commented Nov 16, 2018

@heikoh81 Go test the new release candidate as it is in there.....

@Nachtfalke49
Copy link

Hello,

I habe the same Issue with Shelly 2. After the update from 5.2.1 to 5.2.2RC3 the error is gone.

@sbormann
Copy link

Sorry to warm this up - but i have this error again.
Echo Dot 3rd Gen, when the light ist off and i ask alexa to bring it a dimmed value (lets say 50%), it first fires the "on" command (the light goes to 100%) and right after that it dims to 50%.

The options "On when Dim is present" and "On with First Dim" are both off - but i tried all combinations, nothing worked.

Can someone guide me to the right direction?

Many thanks!

@bwssytems
Copy link
Owner

What version of ha-bridge are you using?

@sbormann
Copy link

Hi, its 5.3.0

@bwssytems
Copy link
Owner

Please turn on debug for the Huemulator class in the log section and then execute the command and post the log please.

@sbormann
Copy link

Hi, this is the log. I tried to dim the device "Deckenleuchte" to 30%:

11-27-2019 23:45:26.921 DEBUG HueMulator GET called on api/* with request <<</api/7fddcc33c3ae4fb2b04cfff08dfaa4d3/lights/16>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:26.922 DEBUG hue light requested: 16 for user: 7fddcc33c3ae4fb2b04cfff08dfaa4d3 from 192.168.10.142 com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:26.922 DEBUG found device named: Wandleuchten com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.832 DEBUG HueMulator PUT called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13/state>>>, and body <<<{"on":true}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.832 DEBUG hue state change requested: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 body: {"on":true} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.832 DEBUG Calling on-off as requested. com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.832 DEBUG Decode Json for url items: [{"item":"http:https://192.168.10.69:8087/set/hm-rpc.0.QEQ0049797.1.LEVEL?value=${intensity.percent}"}] com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.832 DEBUG Calling Home device handler for type : httpDevice com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.847 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/13/bridgeupdatestate>>>, and body <<<{"on":"true","bri":254}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.847 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":254} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.847 DEBUG HueMulator GET called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.848 DEBUG hue light requested: 13 for user: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.848 DEBUG found device named: Deckenleuchte com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.948 DEBUG HueMulator PUT called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13/state>>>, and body <<<{"bri":77}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.948 DEBUG hue state change requested: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 body: {"bri":77} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.948 DEBUG Calling dim as requested. com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.948 DEBUG Decode Json for url items: [{"item":"http:https://192.168.10.69:8087/set/hm-rpc.0.QEQ0049797.1.LEVEL?value=${intensity.percent}"}] com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.948 DEBUG Calling Home device handler for type : httpDevice com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.960 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/13/bridgeupdatestate>>>, and body <<<{"on":"true","bri":76}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.964 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":76} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.970 DEBUG HueMulator GET called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.970 DEBUG hue light requested: 13 for user: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:35.970 DEBUG found device named: Deckenleuchte com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.024 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/13/bridgeupdatestate>>>, and body <<<{"on":"true","bri":1}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.025 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":1} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.289 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/13/bridgeupdatestate>>>, and body <<<{"on":"true","bri":132}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.290 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":132} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.989 DEBUG HueMulator GET called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.990 DEBUG hue light requested: 13 for user: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:36.991 DEBUG found device named: Deckenleuchte com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:38.002 DEBUG HueMulator GET called on api/* with request <<</api/uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH/lights/13>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:38.002 DEBUG hue light requested: 13 for user: uKkCOstaR9Cgy7os2f2j6YppKqYw2AXce0mgujkH from 192.168.10.119 com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:38.002 DEBUG found device named: Deckenleuchte com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:39.294 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/13/bridgeupdatestate>>>, and body <<<{"on":"true","bri":76}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:39.294 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":76} com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:39.502 DEBUG HueMulator PUT called on api/* with request <<</api/x/lights/5/bridgeupdatestate>>>, and body <<<{"on":"true","bri":3}>>> com.bwssystems.HABridge.hue.HueMulator
11-27-2019 23:45:39.503 DEBUG Update state requested: x from 192.168.10.69 body: {"on":"true","bri":3} com.bwssystems.HABridge.hue.HueMulator

@spencerryan
Copy link

spencerryan commented Dec 17, 2019

I'm seeing the same issues with Echo Dot V2's, 5.3.0, and "On when Dim is present" and "On with First Dim" are both off.

Edit: It appears the Echo's are sending two different requests. First "On" and then another with the bri command.

If I tell alexa to turn the bar on I only see a single request (on:true) with no bri value, or second PUT with the bri setting.

I wonder if there is a different way the emulator can respond to Alexa to make it not do this? Alternatively a somewhat hacky workaround seems to simply wait ~1 second and see if a brightness event comes in before doing anything.

12-16-2019 22:13:05.071 DEBUG HueMulator PUT called on api/* with request <<</api/b667f1148159414c914460d50ab072a4/lights/100/state>>>, and body <<<{"on":true}>>> com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.072 DEBUG hue state change requested: b667f1148159414c914460d50ab072a4 from 192.168.1.100 body: {"on":true} com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.073 DEBUG Calling on-off as requested. com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.074 DEBUG Decode Json for url items: [{"item":"http:https://192.168.1.5:8080/ia7/set?$basement_bar=on","type":"httpDevice"}] com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.074 DEBUG Calling Home device handler for type : httpDevice com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.222 DEBUG HueMulator GET called on api/* with request <<</api/b667f1148159414c914460d50ab072a4/lights/100>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.223 DEBUG hue light requested: 100 for user: b667f1148159414c914460d50ab072a4 from 192.168.1.100 com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.224 DEBUG found device named: Bar com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.402 DEBUG HueMulator PUT called on api/* with request <<</api/b667f1148159414c914460d50ab072a4/lights/100/state>>>, and body <<<{"bri":128}>>> com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.403 DEBUG hue state change requested: b667f1148159414c914460d50ab072a4 from 192.168.1.100 body: {"bri":128} com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.403 DEBUG Calling dim as requested. com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.404 DEBUG Decode Json for url items: [{"item":"http:https://192.168.1.5:8080/ia7/set?$basement_bar=${intensity.percent}","type":"httpDevice"}] com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.404 DEBUG Calling Home device handler for type : httpDevice com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.578 DEBUG HueMulator GET called on api/* with request <<</api/b667f1148159414c914460d50ab072a4/lights/100>>>, and body <<<>>> com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.580 DEBUG hue light requested: 100 for user: b667f1148159414c914460d50ab072a4 from 192.168.1.100 com.bwssystems.HABridge.hue.HueMulator
12-16-2019 22:13:05.580 DEBUG found device named: Bar com.bwssystems.HABridge.hue.HueMulator

@coricidin12
Copy link

any real solution to this? I want only dim to fire, regardless of what alexa thinks the device state is. "OnFirstDim" works to send only dim if alexa thinks the device is already on, but if the device state is off and a dim command is received, it still sends the ON command before the dim.

@bwssytems
Copy link
Owner

That is a different twist on that setting. If bright request present with on, only send dim. This would be an enhancement.

@SelmaUrban
Copy link

That is a different twist on that setting. If bright request present with on, only send dim. This would be an enhancement.

Would be nice if it could be found in the next version

@sbormann
Copy link

sbormann commented Dec 28, 2019 via email

@bwssytems
Copy link
Owner

Please open a new issue with the description of what we want to do. I can then make that an enhancement as this issue is for a different request. Thanks

@sbormann
Copy link

sbormann commented Jan 1, 2020

Done: #1171 (comment)
Many thanks!
And best wishes for 2020!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants