homebridge-edomoticz Plugin

Moderator: leecollings

tonymer
Posts: 16
Joined: Wednesday 15 June 2022 16:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by tonymer »

Hello everyone, I have a virtual device in energy automation that tells me the available energy that I have. What type of virtual device do I have to create in domoticz so that it appears in Apple Home? neither rain nor wind appear. Thanks in advance
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: homebridge-edomoticz Plugin

Post by solarboy »

solarboy wrote: Sunday 22 May 2022 20:06 Perhaps in a future update our concerns will be silently resolved... :mrgreen:
So I discovered a solution to the log spamming issue, quite simple really, at least for me.

I had made a typo when setting my "Local Networks" in settings, missing out the final "*" in "127.0.0.*;192.168.1.*;192.168.2.*"

Once I added the asterix, Domoticz no longer logged the connections as incoming and my logs became usable again , huzzah ! :mrgreen:
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by ksacca »

There has been a lot of discussion lately about the changes to the behavior of blinds in the latest beta version. Inverted blinds don't exist anymore, they have now been replaced by options where you can choose to invert the state (Open/Close) or position (slider). Also the command to open and close blinds are now Open and Close instead of On and Off (even though On and Off still works, but the other way around).

As some of you might have noticed, I posted a quick fix on https://github.com/domoticz/domoticz/issues/5371 for blinds which works as long as you don't invert the state or position. I've been looking at the code today to see if a solution can be found (as I don't see a lot of activity on the hombebridge-edomoticz github page).

I was able to get all blind types working for the new blind behavior, as well as the old ones. I didn't change anything for venetian blinds, as I don't have any to test (but I suppose it should work). There is also a new type of blinds in domoticz (Blinds + Stop) that was previously not supported. They are also blinds with position, but just have a stop button. Those blind types are automatically created when using MQTT Autodiscovery, so I added support for them too (just not the stop button, as that's not supported by homebridge as far as I know).

When using the new type of blinds, the Open or Close command will be sent. For older ones, it's still On or Off. The State and Position will be automatically recalculated to be reflected correctly in the home app.

I had to add an option the homebridge-edomoticz settings where you have to set if you use legacy blinds or not (this was the easiest way without having to create a new function). It should be left to 0 when using a recent beta, or set to 1 if using an older version.
homebridge-settings.JPG
homebridge-settings.JPG (43.14 KiB) Viewed 6416 times
If some of you could test if everything works as expected, that would be nice. In attachment to this post you can find the 3 modified files.

config.schema.json - Should be placed in /homebridge/node_modules/homebridge-edomoticz/
constants.js and domoticz_accessory.js - Should be placed in /homebridge/node_modules/homebridge-edomoticz/lib

Don't forget to make a backup of your old files first!!!

PS: Feel free to make adjustments or propose improvements if you have any knowledge of javascript. Also report any bugs with as much details as you can. If it works as expected, we can always create a pull request, in the hope it will be accepted (but I honestly don't know how that all works).

Edit: Deleted files as this pull request has been merged. Update hombridge edomoticz to use these new features.
Last edited by ksacca on Tuesday 20 December 2022 12:07, edited 2 times in total.
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: homebridge-edomoticz Plugin

Post by Marci »

Once folks are happy with the proposed changes, see https://docs.github.com/en/get-started/ ... o-projects for how to create a fork, make your modifications, then submit a pull request.

Long story short: I don’t have any blinds, so can’t test anything to do with blinds.
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!
Stepdes
Posts: 24
Joined: Monday 13 November 2017 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: homebridge-edomoticz Plugin

Post by Stepdes »


If some of you could test if everything works as expected, that would be nice. In attachment to this post you can find the 3 modified files.

config.schema.json - Should be placed in /homebridge/node_modules/homebridge-edomoticz/
constants.js and domoticz_accessory.js - Should be placed in /homebridge/node_modules/homebridge-edomoticz/lib

Don't forget to make a backup of your old files first!!!

PS: Feel free to make adjustments or propose improvements if you have any knowledge of javascript. Also report any bugs with as much details as you can. If it works as expected, we can always create a pull request, in the hope it will be accepted (but I honestly don't know how that all works).
Tested and works for me, thanks for this work arround.

Stephan
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by ksacca »

Marci wrote: Wednesday 19 October 2022 20:15 Once folks are happy with the proposed changes, see https://docs.github.com/en/get-started/ ... o-projects for how to create a fork, make your modifications, then submit a pull request.

Long story short: I don’t have any blinds, so can’t test anything to do with blinds.
Thanks for the info. I already forked the repo and was looking into how to commit changes to it. This link will surely be useful.
I made it so people can actually review and see the changes first before adapting anything (I would also be hesitant to download a random file from a forum). It can be found on https://github.com/ksacca/homebridge-edomoticz for now, but I only edited one file as a test. Will do the other ones tomorrow so all changes are clear and transparant.
Stepdes wrote: Wednesday 19 October 2022 20:47 Tested and works for me, thanks for this work arround.

Stephan
Glad to hear. Let me know if you encounter any issues.
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by ksacca »

I forked homebridge-edomoticz and made all code changes. It is available on https://github.com/ksacca/homebridge-edomoticz.
You can see the changes to the code in each commit.

If you would like to test, you should be able to replace the files using the following commands (replace your-path-to-homebridge-edomoticz by the directory where your edomoticz plugin is installed). A backup of your old file will be made, so you can always revert the changes.

Code: Select all

cd <your-path-to-homebridge-edomoticz>
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/config.schema.json
cd lib
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/lib/constants.js
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/lib/domoticz_accessory.js
Don't forget to restart homebridge once the files have been replaced.

EDIT: Changes have been merged into homebridge edomoticz, so you can now simply update to use these new features. I will delete the forked repo.
Last edited by ksacca on Tuesday 20 December 2022 12:08, edited 1 time in total.
liquidation
Posts: 1
Joined: Tuesday 18 October 2022 15:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by liquidation »

Hi,

It's working smoothly. Thanks a lot. I hope it will be in the main branch soon :-)

Thanks,

/F
Ouate
Posts: 36
Joined: Thursday 03 August 2017 15:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by Ouate »

ksacca wrote: Wednesday 19 October 2022 16:37 There has been a lot of discussion lately about the changes to the behavior of blinds in the latest beta version. Inverted blinds don't exist anymore, they have now been replaced by options where you can choose to invert the state (Open/Close) or position (slider). Also the command to open and close blinds are now Open and Close instead of On and Off (even though On and Off still works, but the other way around).

As some of you might have noticed, I posted a quick fix on https://github.com/domoticz/domoticz/issues/5371 for blinds which works as long as you don't invert the state or position. I've been looking at the code today to see if a solution can be found (as I don't see a lot of activity on the hombebridge-edomoticz github page).

I was able to get all blind types working for the new blind behavior, as well as the old ones. I didn't change anything for venetian blinds, as I don't have any to test (but I suppose it should work). There is also a new type of blinds in domoticz (Blinds + Stop) that was previously not supported. They are also blinds with position, but just have a stop button. Those blind types are automatically created when using MQTT Autodiscovery, so I added support for them too (just not the stop button, as that's not supported by homebridge as far as I know).

When using the new type of blinds, the Open or Close command will be sent. For older ones, it's still On or Off. The State and Position will be automatically recalculated to be reflected correctly in the home app.

I had to add an option the homebridge-edomoticz settings where you have to set if you use legacy blinds or not (this was the easiest way without having to create a new function). It should be left to 0 when using a recent beta, or set to 1 if using an older version.

homebridge-settings.JPG

If some of you could test if everything works as expected, that would be nice. In attachment to this post you can find the 3 modified files.

config.schema.json - Should be placed in /homebridge/node_modules/homebridge-edomoticz/
constants.js and domoticz_accessory.js - Should be placed in /homebridge/node_modules/homebridge-edomoticz/lib

Don't forget to make a backup of your old files first!!!

PS: Feel free to make adjustments or propose improvements if you have any knowledge of javascript. Also report any bugs with as much details as you can. If it works as expected, we can always create a pull request, in the hope it will be accepted (but I honestly don't know how that all works).
I downloaded your plugin update but I don't know how to apply the changes on my raspberry.
When I connected to the ftp, I don't see files in home/homebridge ?!
the node_modules folder is not here in home/homebridge .

Can you help how to make changes, replace files ?

Thanks
ksacca
Posts: 80
Joined: Thursday 31 May 2018 21:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by ksacca »

Hi Ouate,

It depends how homebridge was installed. If you use Homebridge UI, the plugin folder will be shown in the status page under system information.
If not, you could ssh into your pi and run the following command which should help you find the directory:

Code: Select all

sudo find -name "node_modules"
Follow the instructions in this post: https://domoticz.com/forum/viewtopic.ph ... 19#p293619 to install it as it's easier than replacing the files manually (and safer as a backup of the old files is made).
Ouate
Posts: 36
Joined: Thursday 03 August 2017 15:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by Ouate »

many thanks !!! ;) ;)
the installed folder was in /var/

Now I found it, everything works well home bridge now !!
Congratulations for the fix ! :!:


Now I will be grateful to find a working fix for the android Domoticz app
Hann1BaL
Posts: 23
Joined: Sunday 11 March 2018 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: homebridge-edomoticz Plugin

Post by Hann1BaL »

ksacca wrote: Friday 21 October 2022 10:20 I forked homebridge-edomoticz and made all code changes. It is available on https://github.com/ksacca/homebridge-edomoticz.
You can see the changes to the code in each commit.

If you would like to test, you should be able to replace the files using the following commands (replace your-path-to-homebridge-edomoticz by the directory where your edomoticz plugin is installed). A backup of your old file will be made, so you can always revert the changes.

Code: Select all

cd <your-path-to-homebridge-edomoticz>
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/config.schema.json
cd lib
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/lib/constants.js
sudo wget --backups=1 https://raw.githubusercontent.com/ksacca/homebridge-edomoticz/master/lib/domoticz_accessory.js
Don't forget to restart homebridge once the files have been replaced.
This worked for me.
So all the blinds that in the Home app on iOS were marked as incompatible. Updating the files and restarting homebridge updated the blinds and they can now be controlled again (so I can use Siri to close the blinds :D)
Was installed in:

Code: Select all

/usr/lib/node_modules/homebridge-edomoticz/
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by tjabas »

Hi!

i have some plugins that i use to control my philips tv, the only way i got working was to install a plugin in homebridge, i tried install it in domoticz directly but i didnt get it to work.
so my question is if its possible to get domoticz to control these swithes that i have made to control my tv in homebridge?
today i use this edomoticz plugin to get all my switches from domoticz into homebridge, but is it possible to do it the other way?
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by JonyBCN »

tjabas wrote: Saturday 26 November 2022 18:25 Hi!

i have some plugins that i use to control my philips tv, the only way i got working was to install a plugin in homebridge, i tried install it in domoticz directly but i didnt get it to work.
so my question is if its possible to get domoticz to control these swithes that i have made to control my tv in homebridge?
today i use this edomoticz plugin to get all my switches from domoticz into homebridge, but is it possible to do it the other way?
For simple functions involving only button presses you can create dummy buttons in domoticz. These will be displayed in homebridge and through automations in the home app you can link them. I use it for a couple of plugs, but I think doing it with a TV can be cumbersome and impractical. But for things like turning on and off it can be a practical solution.
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by JonyBCN »

Marci wrote: Wednesday 19 October 2022 20:15 Once folks are happy with the proposed changes, see https://docs.github.com/en/get-started/ ... o-projects for how to create a fork, make your modifications, then submit a pull request.

Long story short: I don’t have any blinds, so can’t test anything to do with blinds.
Only partially related: any chance to add flood detectors to the plugin? Smoke detectors and their notifications work very well and seeing flood detectors as switches is a bit of a waste.
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by tjabas »

JonyBCN wrote: Saturday 26 November 2022 19:33
tjabas wrote: Saturday 26 November 2022 18:25 Hi!

i have some plugins that i use to control my philips tv, the only way i got working was to install a plugin in homebridge, i tried install it in domoticz directly but i didnt get it to work.
so my question is if its possible to get domoticz to control these swithes that i have made to control my tv in homebridge?
today i use this edomoticz plugin to get all my switches from domoticz into homebridge, but is it possible to do it the other way?
For simple functions involving only button presses you can create dummy buttons in domoticz. These will be displayed in homebridge and through automations in the home app you can link them. I use it for a couple of plugs, but I think doing it with a TV can be cumbersome and impractical. But for things like turning on and off it can be a practical solution.
thanks for the quick reply, i have looked everywhere in homebridge but i cant find out how to link the button/swithes together in homebridge
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by JonyBCN »

tjabas wrote: Saturday 26 November 2022 19:45 thanks for the quick reply, i have looked everywhere in homebridge but i cant find out how to link the button/swithes together in homebridge
It is not a link, it is an automation directly in the Home app. Something like this: "if Philips TV switch is on" then "Phlipis Dummy switch is on".
You must do it both for on and off. It's cumbersome. It works for me for a plug in the bathroom and another that controls a camera, but for something more complex I don't know if it's worth it.
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by tjabas »

JonyBCN wrote: Saturday 26 November 2022 19:50
tjabas wrote: Saturday 26 November 2022 19:45 thanks for the quick reply, i have looked everywhere in homebridge but i cant find out how to link the button/swithes together in homebridge
It is not a link, it is an automation directly in the Home app. Something like this: "if Philips TV switch is on" then "Phlipis Dummy switch is on".
You must do it both for on and off. It's cumbersome. It works for me for a plug in the bathroom and another that controls a camera, but for something more complex I don't know if it's worth it.
ok, i have been looking in the homebridge website, that one i have installed on my rpi, so i need to download an app for my phone?
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by tjabas »

i fixed it , managed to get rutin to work, so it works great, thank you for your help :)
JonyBCN
Posts: 39
Joined: Tuesday 24 May 2016 22:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by JonyBCN »

JonyBCN wrote: Saturday 26 November 2022 19:35
Marci wrote: Wednesday 19 October 2022 20:15 Once folks are happy with the proposed changes, see https://docs.github.com/en/get-started/ ... o-projects for how to create a fork, make your modifications, then submit a pull request.

Long story short: I don’t have any blinds, so can’t test anything to do with blinds.
Only partially related: any chance to add flood detectors to the plugin? Smoke detectors and their notifications work very well and seeing flood detectors as switches is a bit of a waste.
Nevermind, I just saw that it is Domoticz that does not have a leak sensor as an accessory. As an alternative I have found this, although it has cost me to make it work and I have also changed the pool to 30 seconds (500 milliseconds seems excessive to me and it floods the homebridge log): https://github.com/davidabacon/homebrid ... ased-water sensor.

With domoticz I create the files by script (on and off actions) and it seems to work fine.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest