Page 54 of 86

Re: homebridge-edomoticz Plugin

Posted: Thursday 10 November 2016 11:01
by TheRamon
@simon_rb:

I have just fixed the issue with brightness. How I reproduced it:
- Open Home app
- Dim value to 50% or so.
- Turn off the lamp
- Close and kill Home app
- Reopen Home app
- Turn on the lamp (would return to 100% here..)

Have also committed a new version to the master branch.

Re: homebridge-edomoticz Plugin

Posted: Thursday 10 November 2016 11:17
by TheRamon
@hpapagaj:

It's really really hard for me to reproduce this issue. I saw you're not using MQTT so I've turned that off on my side, too.

Please have a look at my logs. I have created two scenarios. One where the light was already on at 50%~ish. One where the light was totally off (turned it off when the light was 50%~ish).

I have added the Domoticz log and the Philips Hue (emulator) log. Please see what happens.
You'll see the Hue light report brightness 252. That's 100%. (There's still a bug that prevents me from sending 255. But that's another problem).

Light on, 50%. -> SIRI: Dim light 100%.

Code: Select all

Domoticz: 2016-11-10 11:09:49.935  User: Admin initiated a switch command
Domoticz: 2016-11-10 11:09:49.937  (Hue Bridge Emulator) Lighting Limitless/Applamp (Hue Lamp 1)

Philips Hue: Thu, 10 Nov 2016 11:09:49   [{"success":{"/lights/1/state/bri":252}},{"success":{"/lights/1/state/on":true}}]
Light was off, last state was 50%. -> SIRI: Dim light 100%.

Code: Select all

Domoticz: 2016-11-10 11:11:25.941  User: Admin initiated a switch command
Domoticz: 2016-11-10 11:11:25.943  (Hue Bridge Emulator) Lighting Limitless/Applamp (Hue Lamp 1)
Domoticz: 2016-11-10 11:11:25.944  User: Admin initiated a switch command
Domoticz: 2016-11-10 11:11:25.946  (Hue Bridge Emulator) Lighting Limitless/Applamp (Hue Lamp 1)

Philips Hue: Thu, 10 Nov 2016 11:11:25   [{"success":{"/lights/1/state/on":true}}]
Philips Hue: Thu, 10 Nov 2016 11:11:25   [{"success":{"/lights/1/state/bri":252}},{"success":{"/lights/1/state/on":true}}]

Re: homebridge-edomoticz Plugin

Posted: Thursday 10 November 2016 13:51
by simon_rb
TheRamon wrote:@simon_rb:

I have just fixed the issue with brightness. How I reproduced it:
- Open Home app
- Dim value to 50% or so.
- Turn off the lamp
- Close and kill Home app
- Reopen Home app
- Turn on the lamp (would return to 100% here..)

Have also committed a new version to the master branch.
Excellent, I shall try it out tonight when I get home. That really was quick! Top man!

UPDATE:- Hasn't fixed my issue. Force closing and reopening the app doesn't seem to replicate my fault as I tried that before I updated. If you restart homebridge then turn on a dimmer it will jump to 100% and doesn't remember the Domoticz value. So my wall lights said 80% in domoticz, I turned them on from Home App and it went straight to 100% and my wall lights turned on at 80% (Domoticz value) then jumped straight to 100%, Domoticz now shows them at 100%. Hope that helps. If I lower them to 80%, turn them off and when turning them back on they will remember the 80% however if I leave it 5 mins and turn them back on it repeats the same thing (going to 100% and changing domoticz to 100%)

UPDATE2:- Bizzarely is currently working! I'll keep and eye on it. Cheers TheRamon!!

Re: homebridge-edomoticz Plugin

Posted: Friday 11 November 2016 7:56
by TheRamon
I can imagine cached values being empty after restarting "the code". Apparently first time value caching is bugged since it goes to 100%. I'll have a look anyway!

Re: homebridge-edomoticz Plugin

Posted: Friday 11 November 2016 11:00
by TheRamon
^ Have just fixed the dimmer issue. Values are now saved and fetched properly, even when terminating the Homebridge plugin.

Please see master for a new commit.

Re: homebridge-edomoticz Plugin

Posted: Friday 11 November 2016 14:52
by simon_rb
Cheers dude. Amazing work. :)

UPDATE:- Have reset Homebridge after the latest update and its remembered the dimmer values. Top man! Thanks again.

Re: homebridge-edomoticz Plugin

Posted: Friday 11 November 2016 22:38
by madrian
TheRamon wrote:@hpapagaj:
It's really really hard for me to reproduce this issue. I saw you're not using MQTT so I've turned that off on my side, too.
Hi, today I updated to the latest version too, still no luck.

Code: Select all

2016-11-11 22:18:08.359 User: Admin initiated a switch command (25/LED/Set Level)
2016-11-11 22:18:08.365 LUA: dev Set Level: 96 %
2016-11-11 22:18:08.365 LUA: Value received from Domoticz was 31
2016-11-11 22:18:08.365 LUA: Calculated value for ESP is 1023
2016-11-11 22:18:08.365 LUA: Dimming LED to 1023
2016-11-11 22:18:08.365 LUA: echo Fadetimer=2000,LED1_target=1023 | socat - TCP:192.168.1.10:43333
2016-11-11 22:18:08.360 (Quinled_1) Lighting 5 (LED)
2016-11-11 22:18:08.780 User: Admin initiated a switch command (25/LED/On)
2016-11-11 22:18:08.787 LUA: dev On
2016-11-11 22:18:08.787 LUA: Value received from Domoticz was 0
2016-11-11 22:18:08.788 LUA: Calculated value for ESP is 8
2016-11-11 22:18:08.788 LUA: Dimming LED to 8
2016-11-11 22:18:08.788 LUA: echo Fadetimer=2000,LED1_target=8 | socat - TCP:192.168.1.10:43333
2016-11-11 22:18:08.781 (Quinled_1) Lighting 5 (LED)
homebridge.log
[eDomoticz] LED sent command succesfully.
[eDomoticz] LED sent command succesfully.

Here is the LUA script, which is watching the LED status: here. It's so simple, it's only combines together the value of the dimmer + some parameter.

One more info:

Code: Select all

2016-11-11 22:18:08.787 LUA: Value received from Domoticz was 0
2016-11-11 22:18:08.788 LUA: Calculated value for ESP is 8
Don't brother with this one. Received value was 0, because I can't receive the last state of the switched off dimmer ( :evil: ), so we switching to the first brightness, which is 8.

The only question is that why it is still requesting an On command after Set Level. :twisted:

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 14:45
by aram
I have an outdoor Oregon temp/humidity/pressure device + weather underground setup. on domoticz web interface all the measurements are correct.
however using Eve and Home apps negative temperature values are converted to positive. e.g. now its -4.8C outside, it shows as 4.8C in Eve and 5C in Home. I had the same issue with both non MQTT version and after switching to MQTT. Bug or an issue on my side?

Another strange issue - Eve shows all devices from Domoticz while Home shows Unsupported or does not show at all. is this expected behaviour?

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 15:59
by simon_rb
@TheRamon,

I have a 100 step dimmer that for some reason is 1% below the domoticz dimmer value. Its a 0-99 step dimmer.. I'll say set my Surround Sound to 65 and it will set it to 64 in domoticz.. However if it set it to 65 in Domoticz it will stay at 64 within Homekit.. Can't quite figure it out lol

Just checked all my 0-99 dimmers and all behave the same lol 1% out when using Siri or Homekit sliders

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 16:56
by MikeF
@simon_rb, what do you use for your 100-step dimmers?

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 17:01
by simon_rb
MikeF wrote:@simon_rb, what do you use for your 100-step dimmers?
LMS player and Denon Amp volumes


Sent from my iPhone using Tapatalk

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 17:10
by G3rard
@TheRamon

I also have a 100 step dimmer (just as simon_rb) and have an issue when updating it via Siri.

Code: Select all

2016-11-12 15:42:29.022 Dummy: Light/Switch | Sonos keuken volume 
2016-11-12 15:42:29.021 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":411,"switchcmd":"On"}
2016-11-12 15:42:28.871 Dummy: Light/Switch | Sonos keuken volume 
2016-11-12 15:42:28.871 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":411,"level":30,"switchcmd":"Set Level"}
It is sending a On command after updating the level. That is causing the volume being set to 0.

Strange thing is that I updated eDomoticz to the latest version and then added the above switch (idx=411).

With a switch which was already there before updating eDomoticz, the On command is being sent before the level update (see below idx=409) and then it is working fine.

Code: Select all

2016-11-12 15:40:26.094 Dummy: Light/Switch | Sonos kantoor volume 
2016-11-12 15:40:26.094 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":409,"level":20,"switchcmd":"Set Level"}
2016-11-12 15:40:25.943 Dummy: Light/Switch | Sonos kantoor volume 
2016-11-12 15:40:25.942 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":409,"switchcmd":"On"}
Information on the dimmer

Code: Select all

"SubType" : "Switch",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
Any idea's how to prevent the On command from being send, or at least being send before setting the level?

Edit: SOLVED, did a npm update but that's not containing the latest git changes.
Thanks simon_rb :)

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 17:15
by simon_rb
@G3rard

Have you updated from the latest branch via git rather than NPM. I don't think the fix has been implemented to NPM branch yet..

The behaviour your describing is what was happening to me before TheRamon fixed the issue.

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 17:31
by G3rard
Used NPM update indeed. Shall update via Git this evening. Cheers.

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 18:55
by MikeF
aram wrote:
Another strange issue - Eve shows all devices from Domoticz while Home shows Unsupported or does not show at all. is this expected behaviour?
I believe that it is the case that the iOS 10 Home app doesn't support combined temp / humidity / pressure sensors - I have the same with a MySensors node which I built - shows OK in Eve.

Re: homebridge-edomoticz Plugin

Posted: Saturday 12 November 2016 22:36
by G3rard
simon_rb wrote:@G3rard

Have you updated from the latest branch via git rather than NPM. I don't think the fix has been implemented to NPM branch yet..

The behaviour your describing is what was happening to me before TheRamon fixed the issue.
I indeed updated via NPM earlier, so to update via git I have done the following steps:

Code: Select all

sudo rm -r /usr/lib/node_modules/homebridge-edomoticz/
then in /usr/lib/node_modules/

Code: Select all

sudo git clone https://github.com/PatchworkBoy/homebridge-edomoticz.git 
But restarting homebridge gives the following error:

Code: Select all

Error: The requested platform 'eDomoticz' was not registered by any plugin.
What am I missing? I tried a 'npm update' but that makes no difference.
Also the homebridge-edomoticz gets installed in that folder, so that went okay.

Edit: solved it by manually updating the changed files in the homebridge-edomoticz/lib folder.
But there must be an easier way :?
At least the dimmer issues are gone now :mrgreen:

Re: homebridge-edomoticz Plugin

Posted: Sunday 13 November 2016 0:10
by G3rard
simon_rb wrote:@TheRamon,

I have a 100 step dimmer that for some reason is 1% below the domoticz dimmer value. Its a 0-99 step dimmer.. I'll say set my Surround Sound to 65 and it will set it to 64 in domoticz.. However if it set it to 65 in Domoticz it will stay at 64 within Homekit.. Can't quite figure it out lol

Just checked all my 0-99 dimmers and all behave the same lol 1% out when using Siri or Homekit sliders
Seems to be something that is caused by MQTT. When sending the following to MQTT directly

Code: Select all

mosquitto_pub -h localhost -t "domoticz/in" -m '{"command":"switchlight","idx":409,"level":2,"switchcmd":"Set Level"}'
it also sets the level 1 lower.

I have changed the following code in domoticz_accessory.js

Code: Select all

var dim = (level / this.factor == 15) ? 16 : level / this.factor;
to

Code: Select all

var dim = (level / this.factor == 15) ? 16 : (level / this.factor) + 1;
and then it is working fine.
Not sure although if that is the best solution.

Re: homebridge-edomoticz Plugin

Posted: Sunday 13 November 2016 0:14
by simon_rb
Sorry G3rard, been out. Have you got the git working?


Sent from my iPhone using Tapatalk

Re: homebridge-edomoticz Plugin

Posted: Sunday 13 November 2016 0:25
by G3rard
No, solved it by manually updating the changed files in the homebridge-edomoticz/lib folder.
Have an issue when updating via git, see http://www.domoticz.com/forum/viewtopic ... 99#p103888.

Re: homebridge-edomoticz Plugin

Posted: Sunday 13 November 2016 0:27
by simon_rb
Glad you got it to work. Might have to do the above if that fixes the 1% discrepancy.. maybe TheRamon will implement it..


Sent from my iPhone using Tapatalk