homebridge-edomoticz Plugin

Moderator: leecollings

User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

@TheRamon - I’ve knocked up an mqtt-integration branch over on github... and an issue raised to cover, should you feel the urge to tinker! See https://github.com/PatchworkBoy/homebri ... /issues/29 - Currently it connects to the domoticz/out stream and echoes any messages to the homebridge log. Need to work out how best to parse and then affect those changes back to HomeKit. Am referencing cflurin’s homebridge-mqtt plugin for the foundations.

There are some caveats to be aware of thru doing this tho... namely, amount of generated traffic = increase in mem load on a lowly RaspPi B+ (for instance), and (more importantly) this will result in a significant impact on battery life for devices connected to HomeKit depending on how many Domoticz accessories one has and how frequently sensors update within Domoticz.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
sandurz
Posts: 14
Joined: Thursday 28 July 2016 16:52
Target OS: Windows
Domoticz version:
Contact:

Re: eDomoticz Homebridge-Plugin

Post by sandurz »

Nice work! You're the fastest dev ever. As you go forward it might be nice to have an MQTT inclusion/exclusion prefix or just name list option in the config since it might not be critical for every device to go real time.

I was rigging something up today with the same new homebridge-mqtt platform to test out controlling actual non-homebridge HomeKit devices direct from Domoticz using native iOS triggers and dummy switches and man it works great now that we can go real time with MQTT. Very exciting stuff.
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Hi,

I have som problem with my thermostat when using it in eDomiticz.

I have a Popp Radiator Thermostat (the same as Danfoss LC-13 but this can report the temp) which I can control from Domoticz without any problem.
In Domoticz I can see and set the temperature correctly.

On my iPhone I'm using Elgato Eve to add homekit devices and I can add the Homebridge without problems.
But when I'm viewing the thermostat, both current temp and target temp is the same.
Do you know why and how I can fix this?

As you can see the current temperature shows as a an own accessory also but the value should also be in the thermostat.
Both thees

See the attached image...
Thanks!
Attachments
IMG_0565.jpg
IMG_0565.jpg (131.53 KiB) Viewed 2170 times
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: eDomoticz Homebridge-Plugin

Post by TheRamon »

Oh wow. Great work. Memory load might be a thing, jeps. I'd love to take a look. Might be tonight or tomorrow, don't know yet. I'll keep you updated!
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

anasazi wrote:Hi,

I have som problem with my thermostat when using it in eDomiticz.

I have a Popp Radiator Thermostat (the same as Danfoss LC-13 but this can report the temp) which I can control from Domoticz without any problem.
In Domoticz I can see and set the temperature correctly.

On my iPhone I'm using Elgato Eve to add homekit devices and I can add the Homebridge without problems.
But when I'm viewing the thermostat, both current temp and target temp is the same.
Do you know why and how I can fix this?

As you can see the current temperature shows as a an own accessory also but the value should also be in the thermostat.
Both thees

See the attached image...
Thanks!
See first post, q & a's... need JSON output for the device to be able to investigate.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Marci wrote:
anasazi wrote:Hi,

I have som problem with my thermostat when using it in eDomiticz.

I have a Popp Radiator Thermostat (the same as Danfoss LC-13 but this can report the temp) which I can control from Domoticz without any problem.
In Domoticz I can see and set the temperature correctly.

On my iPhone I'm using Elgato Eve to add homekit devices and I can add the Homebridge without problems.
But when I'm viewing the thermostat, both current temp and target temp is the same.
Do you know why and how I can fix this?

As you can see the current temperature shows as a an own accessory also but the value should also be in the thermostat.
Both thees

See the attached image...
Thanks!
See first post, q & a's... need JSON output for the device to be able to investigate.
Sorry about that.
When I'm running this "http:/xxx.xxx.xxx.xxx/json.htm?type=devices&rid=ID3, all I get is this:
{
"ActTime" : 1470476433,
"ServerTime" : "2016-08-06 11:40:33",
"Sunrise" : "05:18",
"Sunset" : "20:58",
"status" : "OK",
"title" : "Devices"
}

I don't get any result.
Am I doing something wrong?
Tried it with Chrome and JSONView but it's the same...
I'm using an Aeon Labs Z-Stick if it does matter.
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

S'the ID3 - that's wrong. You want the IDX number for your thermostat from your devices list there... (Settings > Devices in Domoticz)
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Marci wrote:
anasazi wrote:Hi,

I have som problem with my thermostat when using it in eDomiticz.

I have a Popp Radiator Thermostat (the same as Danfoss LC-13 but this can report the temp) which I can control from Domoticz without any problem.
In Domoticz I can see and set the temperature correctly.

On my iPhone I'm using Elgato Eve to add homekit devices and I can add the Homebridge without problems.
But when I'm viewing the thermostat, both current temp and target temp is the same.
Do you know why and how I can fix this?

As you can see the current temperature shows as a an own accessory also but the value should also be in the thermostat.
Both thees

See the attached image...
Thanks!
See first post, q & a's... need JSON output for the device to be able to investigate.
Got it!
Here comes the json output:

{
"ActTime" : 1470479795,
"ServerTime" : "2016-08-06 12:36:35",
"Sunrise" : "05:18",
"Sunset" : "20:58",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "22.0",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 2,
"HardwareName" : "Aeon Labs Z-Stick",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveTimeout" : false,
"ID" : "0000501",
"LastUpdate" : "2016-08-06 12:34:52",
"Name" : "Kökstermostat",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"SetPoint" : "22.0",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "SetPoint",
"Timers" : "false",
"Type" : "Thermostat",
"TypeImg" : "override_mini",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "2"
}
],
"status" : "OK",
"title" : "Devices"
}
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

The data and setpoint fields are the only two we care about - both read 22. Is that the case? (Presume one is current, other is target)
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Marci wrote:The data and setpoint fields are the only two we care about - both read 22. Is that the case? (Presume one is current, other is target)
Correct!

Here is the output for the temperature device in Domoticz which is from the same physical thermostat device as device 2 (idx):

{
"ActTime" : 1470480369,
"ServerTime" : "2016-08-06 12:46:09",
"Sunrise" : "05:18",
"Sunset" : "20:58",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "23.5 C",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 2,
"HardwareName" : "Aeon Labs Z-Stick",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveTimeout" : false,
"ID" : "0501",
"LastUpdate" : "2016-08-06 12:44:36",
"Name" : "Kökstemperatur",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "LaCrosse TX3",
"Temp" : 23.50,
"Timers" : "false",
"Type" : "Temp",
"TypeImg" : "temperature",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "3"
}
],
"status" : "OK",
"title" : "Devices"
}

So the current temperature should be around 23.5 and the target 22.
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

Right. The two are separate devices within Domoticz. Nothing can be done without some butchery. HomeKit expects a single device to present all the info, not to be split across multiple devices.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Marci wrote:Right. The two are separate devices within Domoticz. Nothing can be done without some butchery. HomeKit expects a single device to present all the info, not to be split across multiple devices.
Do you want me to create an issue over at Github or is this enough information for you?
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

It's not something I can fix really... until Domoticz handles the thermostat within a single device, the plugin can't. S'just a general incompatibility between Domoticz' way of handling that particular hardware vs the apple-certified way.

I have the same issue with my thermostat, as do most others.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

eDomoticz Homebridge-Plugin

Post by Marci »

Nb: the thermostat will still work correctly. Changing the setpoint will still work, but any on/off rules based on that setpoint are handled by Domoticz, not HomeKit.

Ie: problem is visual, doesn't affect functionality.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: eDomoticz Homebridge-Plugin

Post by anasazi »

Ok, now I understand.
Thanks for the explanation :)
NewFolk
Posts: 39
Joined: Wednesday 02 September 2015 11:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: eDomoticz Homebridge-Plugin

Post by NewFolk »

Marci wrote:That's not the JSON output from Domoticz... that's the Homebridge run-log.

See https://www.domoticz.com/wiki/Domoticz_ ... fic_device

Sorry for my very late response.

It`s JSON from my RGBW Milight bulb.
Spoiler: show

Code: Select all

{
   "ActTime" : 1470565164,
   "ServerTime" : "2016-08-07 13:19:24",
   "Sunrise" : "04:48",
   "Sunset" : "20:22",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "Off",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 5,
         "HardwareName" : "Mi Light",
         "HardwareType" : "Limitless/AppLamp/Mi Light with LAN/WiFi interface",
         "HardwareTypeVal" : 22,
         "HaveDimmer" : true,
         "HaveGroupCmd" : false,
         "HaveTimeout" : false,
         "ID" : "1",
         "Image" : "Light",
         "IsSubDevice" : false,
         "LastUpdate" : "2016-08-07 13:18:16",
         "Level" : 78,
         "LevelInt" : 78,
         "MaxDimLevel" : 100,
         "Name" : "Torchere",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "Status" : "Off",
         "StrParam1" : "",
         "StrParam2" : "",
         "SubType" : "RGBW",
         "SwitchType" : "Dimmer",
         "SwitchTypeVal" : 7,
         "Timers" : "false",
         "Type" : "Lighting Limitless/Applamp",
         "TypeImg" : "dimmer",
         "Unit" : 1,
         "Used" : 1,
         "UsedByCamera" : false,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "116"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}

UPD: ALL WORKS !

I don`t know why, I just came home after my vacation, update homebridge and edomoticz. re add lamps and now could change colors.

Thank you!
simon_rb
Posts: 612
Joined: Wednesday 07 August 2013 19:09
Target OS: -
Domoticz version:
Location: UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by simon_rb »

This MQTT stuff looks promising. Been looking for a way to speed the whole refresh process up. Hope we can get it to work without too much hog on resources.

This is still a great plugin and one I use pretty much all the time! Thanks again Marci!!


Sent from my iPhone using Tapatalk
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Nautilus »

This might be more of a question to Homebridge devs but after updating the plugin yesterday I'm only getting "Sorry, I can't do that." from Siri but e.g. the Eve App is showing devices correctly and also controls them. Any idea what might be causing the issue with Siri? I had not used Siri for a while so I cannot say for sure if the update had anything to do with it :)


=== EDIT ===
Ok, this was "solved" by resetting the homekit configuration. Do you think there would've been some other way which would not have involved loosing the configuration? :D
==========
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: eDomoticz Homebridge-Plugin

Post by TheRamon »

Heya,

I have just created a pull request on mqtt-integration.
This is basically the first proof of concept that MQTT integration works. I have messed about with a lot of files, hope you don't mind Marci.
Also split up the platform and accessory since they were in one file.

Basically, this works as follows:
  • Press the switch in domoticz
  • A message gets sent through MQTT
  • MQTT.js picks this up, searches for the right accessory and calls a function on this accessory named handleMQTTMessage.
  • This function is almost the same as getServices. Searches the right service based on swTypeVal, extracts the Characteristic from it, and sends the updated value to Homekit.
  • This might not be perfect, hence my comment in domoticz_accessory.js:759:
// TODO: Build the implementation for dimmers + RGB.
// !! This is where I stopped for now, we'd have to think of a good way to get a sane value from 'nvalue'.
// The getdValue function does this perfectly. The only downside is that it updates the value in domoticz too, resulting in a MQTT loop. (See the comment above silentlyUpdateCharacteristicValue in mqtt.js)


I really don't want to create the setdValue twice, but the way it works now, it also makes a HTTP request to the JSON api. This request sends a MQTT message in it's turn, which is picked up by mqtt.js, leading to an infinite loop.
We might have to fiddle about with a few things to specify if we'd want to update the value in domoticz too. (Send HTTP request)

Any ideas?

- Ramon
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: eDomoticz Homebridge-Plugin

Post by TheRamon »

Nautilus wrote:This might be more of a question to Homebridge devs but after updating the plugin yesterday I'm only getting "Sorry, I can't do that." from Siri but e.g. the Eve App is showing devices correctly and also controls them. Any idea what might be causing the issue with Siri? I had not used Siri for a while so I cannot say for sure if the update had anything to do with it :)


=== EDIT ===
Ok, this was "solved" by resetting the homekit configuration. Do you think there would've been some other way which would not have involved loosing the configuration? :D
==========
This is probably because something got messed up along the way.. I don't think there's any way to debug this. Only thing is to remove the "persist" folder and try again.. A pain, I know.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest