Page 59 of 86

Re: homebridge-edomoticz Plugin

Posted: Tuesday 29 November 2016 16:26
by TheRamon
possible wrote:Hi all,

I installed a fresh installation of Homebridge on my Raspberry Pi. However, it is not starting anymore.
Please verify if your Domoticz installation is running on port 8080 on that same machine. Are you using a username/pw to connect?

Also, please change your config to:

Code: Select all

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:21:3E:E4:DE:33",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "Configuration file for (e)xtended Domoticz platform.",
    "platforms": [
        {
            "platform": "eDomoticz",
            "name": "eDomoticz",
            "server": "127.0.0.1",
            "port": "8080",
            "ssl": 0,
            "roomid": 0,
            "mqtt": 0
        }
    ],
    "accessories": []
}
Since the old mqttenabled is not supported anymore.

Re: homebridge-edomoticz Plugin

Posted: Tuesday 29 November 2016 18:17
by possible
TheRamon wrote:
possible wrote:Hi all,

I installed a fresh installation of Homebridge on my Raspberry Pi. However, it is not starting anymore.
Please verify if your Domoticz installation is running on port 8080 on that same machine. Are you using a username/pw to connect?

Also, please change your config to:

Code: Select all

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:21:3E:E4:DE:33",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "Configuration file for (e)xtended Domoticz platform.",
    "platforms": [
        {
            "platform": "eDomoticz",
            "name": "eDomoticz",
            "server": "127.0.0.1",
            "port": "8080",
            "ssl": 0,
            "roomid": 0,
            "mqtt": 0
        }
    ],
    "accessories": []
}
Since the old mqttenabled is not supported anymore.
Hi,

Domoticz is running on port 8080 on the same machine. It has no password or username installed.

edit: Nevermind. I figured out. I did not had installed any devices in Domoticz. I added some bulbs and now its working fine.

PS: Is it possible to use homebridge with a password protected domoticz?

Re: homebridge-edomoticz Plugin

Posted: Wednesday 30 November 2016 15:44
by possible
New problem.

I installed the WOL plugin to turn on my NAS server with siri.

I installed the plugin but it fails with:

DEBUG:

Code: Select all

usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:47
        this.wrap = new raw.SocketWrap (
                    ^

Error: Operation not permitted
    at Error (native)
    at new Socket (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:47:14)
    at Object.exports.createSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:202:9)
    at Session.getSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:147:20)
    at new Session (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:101:7)
    at Object.exports.createSession (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:545:9)
    at new Pinger (/usr/local/lib/node_modules/homebridge-wol/index.js:114:24)
    at new Computer (/usr/local/lib/node_modules/homebridge-wol/index.js:28:16)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:29)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:38)
    

Re: homebridge-edomoticz Plugin

Posted: Wednesday 30 November 2016 17:01
by madrian
@TheRamon:

Tried (after turned the LED on):

SET BEDLED to 100%
DIM BEDLED to 100%

....If I ask Set LED ON it just works, the On command is not sent twice. Just the dimming command is wrong.

Code: Select all

2016-11-30 16:43:34.510 User: Admin initiated a switch command (31/BEDLED/Set Level)
2016-11-30 16:43:34.515 LUA: dev Set Level: 96 %
2016-11-30 16:43:34.515 LUA: Value received from Domoticz was 31
2016-11-30 16:43:34.515 LUA: Calculated value for ESP is 1023
2016-11-30 16:43:34.515 LUA: Dimming BEDLED to 1023
2016-11-30 16:43:34.515 LUA: echo Fadetimer1=2000,LED2_target=1023 | socat - TCP:192.168.1.11:43333
2016-11-30 16:43:34.510 (LED) Lighting 5 (BEDLED)
2016-11-30 16:43:34.656 User: Admin initiated a switch command (31/BEDLED/On)
2016-11-30 16:43:34.663 LUA: dev On
2016-11-30 16:43:34.663 LUA: Value received from Domoticz was 0
2016-11-30 16:43:34.663 LUA: Calculated value for ESP is 8
2016-11-30 16:43:34.663 LUA: Dimming BEDLED to 8
2016-11-30 16:43:34.663 LUA: echo Fadetimer1=2000,LED2_target=8 | socat - TCP:192.168.1.11:43333

....... :evil:

But I got a good idea (I think). Can you please try out my code? It just generate a link, so I it should work without device as well.

1, create a dimmer:

(I assume you have a dummy device already, in my case it is named "Dummy")
In Switches menu click to Manual/Light Switch. In the popup choose these values:

Hardware: Dummy
Device Name: LED
Switch type: Dimmer
Type: LightwaveRF
ID: random
Unit code: random
As: main device.

You now have a dimmer like this:
Screen-Shot-2016-11-30-16-51-47.png
Screen-Shot-2016-11-30-16-51-47.png (33.51 KiB) Viewed 2872 times
2, The script:

Put this script to

/[DOMOTICZDIRECTORY]/scripts/lua/script_device_LED.lua

filename, must be exactly same (LED=Dimmer name): script_device_LED.lua

I removed os.execute to not execute the socat command (it's like curl), it just prints the executed command.

...........in Domoticz log you you will see that the On command is executed after.

Re: homebridge-edomoticz Plugin

Posted: Thursday 01 December 2016 17:07
by TroisSix
Hi,
Homebridge is working well on my pi3 (I have done a migration from my pi2). I really don't know how I have made it worked, because I tried so many things... and the last action was to copy the files in '~/.homebridge/persist' from my pi2 to my new pi3... That was the only way to see my device "homebridge" on my iphone without reconfigure everything on my iphone ;)

I just have a single question: where can I find the logs of homebridge?
I used to find it in the ~/.forever folder, but now I use 'sudo systemctl start homebridge' to start homebridge, I'm not using forever anymore :!:
To see the status of homebridge, I use 'sudo systemctl status homebridge.service -l'
but where can I find those files? nothing in /var/log, nothing in ~/.homebridge, nothing in ~/homebridge, ...

An idea? :D

Re: homebridge-edomoticz Plugin

Posted: Saturday 03 December 2016 1:35
by planetf1
I have the latest domoticz (beta), edomoticz & homebridge plugin installed, but when run I get:

[12/3/2016, 12:34:39 AM] Loaded plugin: homebridge-edomoticz
[12/3/2016, 12:34:39 AM] Registering accessory 'homebridge-edomoticz.eDomoticz'
[12/3/2016, 12:34:39 AM] Registering platform 'homebridge-edomoticz.eDomoticz'
[12/3/2016, 12:34:39 AM] ---
[12/3/2016, 12:34:39 AM] Loaded config.json with 0 accessories and 1 platforms.
[12/3/2016, 12:34:39 AM] ---
[12/3/2016, 12:34:39 AM] Loading 1 platforms...
[12/3/2016, 12:34:39 AM] [eDomoticz] Initializing eDomoticz platform...
[12/3/2016, 12:34:39 AM] Loading 0 accessories...
[12/3/2016, 12:34:39 AM] [eDomoticz] There was a problem connecting to Domoticz.
pi@raspberrypi3:/usr/bin $


I have cleaned out ~/.homebridge/persist

My config is:
{
"bridge": {
"name": "Homebridge",
"username": "CC:21:3E:E4:DE:33",
"port": 51826,
"pin": "031-45-154"
},
"description": "Configuration file for (e)xtended Domoticz platform.",
"platforms": [
{
"platform": "eDomoticz",
"name": "eDomoticz",
"server": "127.0.0.1",
"port": "8080",
"ssl": 0,
"roomid": 2,
"mqtt": 0
}
],
"accessories": [
]
}

Any ideas?

Re: homebridge-edomoticz Plugin

Posted: Saturday 03 December 2016 1:36
by planetf1
I should add domoticz is on the localhost at port 8080 & working fine ....

Re: homebridge-edomoticz Plugin

Posted: Saturday 03 December 2016 23:55
by Trigun
TroisSix wrote:Hi,
Homebridge is working well on my pi3 (I have done a migration from my pi2). I really don't know how I have made it worked, because I tried so many things... and the last action was to copy the files in '~/.homebridge/persist' from my pi2 to my new pi3... That was the only way to see my device "homebridge" on my iphone without reconfigure everything on my iphone ;)

I just have a single question: where can I find the logs of homebridge?
I used to find it in the ~/.forever folder, but now I use 'sudo systemctl start homebridge' to start homebridge, I'm not using forever anymore :!:
To see the status of homebridge, I use 'sudo systemctl status homebridge.service -l'
but where can I find those files? nothing in /var/log, nothing in ~/.homebridge, nothing in ~/homebridge, ...

An idea? :D
Hi there, sorry to bother you but I have a question regarding the use of homebridge with domoticz.
can you please let me know how you've installed homebridge and got it working?
I am fairly new to this, I've tried a lot of things and nothing seems to work yet.
I got a Pi3.

Thnx in advance!

Re: homebridge-edomoticz Plugin

Posted: Sunday 04 December 2016 10:26
by fennec62
Hi

is it normal that temperature is not negative on Home ? and eve too ?
Capture d’écran 2016-12-04 à 10.22.19.png
Capture d’écran 2016-12-04 à 10.22.19.png (32.05 KiB) Viewed 2749 times
IMG_0337.PNG
IMG_0337.PNG (219.38 KiB) Viewed 2749 times
thanks

Re: homebridge-edomoticz Plugin

Posted: Sunday 04 December 2016 11:09
by G3rard
Here it shows negative values in both Home and Eve app.
Image

Re: homebridge-edomoticz Plugin

Posted: Sunday 04 December 2016 12:49
by NewFolk
Hello,
Is there any updates about MQTT and RGB support ?

UPD I tried :) And It's work! Thank you.
Application work great, but Siri command does not work, I think it's apple servers problem. thank you!

Re: homebridge-edomoticz Plugin

Posted: Sunday 04 December 2016 19:02
by fennec62
G3rard wrote:Here it shows negative values in both Home and Eve app.
Image

thanks

so i thinks it's my install

i try to reinstall

Thanks a lot

Re: homebridge-edomoticz Plugin

Posted: Sunday 04 December 2016 19:55
by nowy1
Hello,

I have installed on the server domoticz synology can I somehow install
homebridge-edomoticz ?

Re: homebridge-edomoticz Plugin

Posted: Monday 05 December 2016 8:01
by anba
I get homebridge to run for a couple of seconds and then it crashes with the following message:

Code: Select all

[12/5/2016, 7:34:23 AM] [eDomoticz] Successfully connected to MQTT broker.
/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:940
                                                        var RFXMeterDeviceCharacteristic = this.getService(eDomoticzServices.WaterDeviceService).getCharacteristic(eDomoticzServices.WaterFlow);
                                                                                                                                                ^

TypeError: Cannot read property 'getCharacteristic' of undefined
    at Object.eDomoticzAccessory.handleMQTTMessage (/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:940:96)
    at MqttClient.<anonymous> (/usr/local/lib/node_modules/homebridge-edomoticz/lib/mqtt.js:77:17)
    at emitThree (events.js:116:13)
    at MqttClient.emit (events.js:194:7)
    at MqttClient._handlePublish (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:792:12)
    at MqttClient._handlePacket (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:282:12)
    at process (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:238:12)
    at Writable.writable._write (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:248:5)
    at doWrite (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/readable-stream/lib/_stream_writable.js:227:5)
It worked fine before i started using MQTT. I have the latest version of homebridge installed.

Can someone help me?

Re: homebridge-edomoticz Plugin

Posted: Monday 05 December 2016 15:30
by TheRamon
possible wrote: PS: Is it possible to use homebridge with a password protected domoticz?
Yep, it is. Just prepend your username and password in your config > server.
e.g.

Code: Select all

"platform": "eDomoticz",
"name": "eDomoticz",
"server": "ramon:[email protected]",
"port": "8081",
TroisSix wrote:but where can I find those files? nothing in /var/log, nothing in ~/.homebridge, nothing in ~/homebridge, ...
An idea? :D
Usually, log should be in /var/log/homebridge.log and /var/log/homebridge.err ...

planetf wrote:I have the latest domoticz (beta), edomoticz & homebridge plugin installed, but when run I get:
[12/3/2016, 12:34:39 AM] [eDomoticz] There was a problem connecting to Domoticz.
Any ideas?
I've added more debug information to "There was a problem connecting to Domoticz".. Could you try updating through NPM and try again?
NewFolk wrote: Hello,
Is there any updates about MQTT and RGB support ?
No updates, should all work well.

anba wrote:I get homebridge to run for a couple of seconds and then it crashes with the following message:

It worked fine before i started using MQTT. I have the latest version of homebridge installed.

Can someone help me?
Not really sure what the problem is here, I'll try and have a look. Could you post the device json output of your RFXMeter Counter?
See the first post for instructions.

Re: homebridge-edomoticz Plugin

Posted: Monday 05 December 2016 15:31
by TheRamon
hpapagaj wrote:@TheRamon:

But I got a good idea (I think). Can you please try out my code? It just generate a link, so I it should work without device as well.

...
Will try this now.

EDIT: Have tried.. so weird.. Still not getting anything. Please see the output below:

Siri, dim my lights to 50%:

Code: Select all

2016-12-05 16:12:07.944  MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":20,"level":17,"switchcmd":"Set Level"}
2016-12-05 16:12:07.946  LUA: dev Set Level: 50 %
2016-12-05 16:12:07.946  LUA: Value received from Domoticz was 16 
2016-12-05 16:12:07.946  LUA: Calculated value for ESP is 289 
2016-12-05 16:12:07.946  LUA: Dimming LED to 289 
2016-12-05 16:12:07.946  LUA: echo Fadetimer=2000,LED1_target=289 | socat - TCP:192.168.1.10:43333 
2016-12-05 16:12:07.944  (Dummydev) Lighting 5 (LED)

Re: homebridge-edomoticz Plugin

Posted: Monday 05 December 2016 17:47
by anba
TheRamon wrote:
anba wrote:I get homebridge to run for a couple of seconds and then it crashes with the following message:

It worked fine before i started using MQTT. I have the latest version of homebridge installed.

Can someone help me?
Not really sure what the problem is here, I'll try and have a look. Could you post the device json output of your RFXMeter Counter?
See the first post for instructions.
Thanks for your reply.

I don't have a water flow device as the code says. I got three counters and they output the following:

Code: Select all

{
   "ActTime" : 1480956307,
   "ServerTime" : "2016-12-05 17:45:07",
   "Sunrise" : "09:04",
   "Sunset" : "13:54",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "Counter" : "204.268 kWh",
         "CounterToday" : "18.521 kWh",
         "CustomImage" : 0,
         "Data" : "204.268 kWh",
         "Description" : "",
         "Favorite" : 0,
         "HardwareID" : 8,
         "HardwareName" : "RFXtrx433E",
         "HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
         "HardwareTypeVal" : 1,
         "HaveTimeout" : false,
         "ID" : "02F2",
         "LastUpdate" : "2016-12-05 17:44:35",
         "Name" : "Räknare el FVP",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : 7,
         "SubType" : "RFXMeter counter",
         "SwitchTypeVal" : 0,
         "Timers" : "false",
         "Type" : "RFXMeter",
         "TypeImg" : "counter",
         "Unit" : 0,
         "Used" : 1,
         "ValueQuantity" : "",
         "ValueUnits" : "",
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "48"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}

Code: Select all

{
   "ActTime" : 1480956431,
   "ServerTime" : "2016-12-05 17:47:11",
   "Sunrise" : "09:04",
   "Sunset" : "13:54",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "Counter" : "1439.357 kWh",
         "CounterToday" : "18.521 kWh",
         "CustomImage" : 0,
         "Data" : "1439.357 kWh",
         "Description" : "",
         "Favorite" : 0,
         "HardwareID" : 8,
         "HardwareName" : "RFXtrx433E",
         "HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
         "HardwareTypeVal" : 1,
         "HaveTimeout" : false,
         "ID" : "03F3",
         "LastUpdate" : "2016-12-05 17:46:40",
         "Name" : "Räknare el VP garage",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : 7,
         "SubType" : "RFXMeter counter",
         "SwitchTypeVal" : 0,
         "Timers" : "false",
         "Type" : "RFXMeter",
         "TypeImg" : "counter",
         "Unit" : 0,
         "Used" : 1,
         "ValueQuantity" : "",
         "ValueUnits" : "",
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "49"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}

Code: Select all

{
   "ActTime" : 1480956461,
   "ServerTime" : "2016-12-05 17:47:41",
   "Sunrise" : "09:04",
   "Sunset" : "13:54",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "Counter" : "7010.668 kWh",
         "CounterToday" : "13.452 kWh",
         "CustomImage" : 0,
         "Data" : "7010.668 kWh",
         "Description" : "",
         "Favorite" : 0,
         "HardwareID" : 8,
         "HardwareName" : "RFXtrx433E",
         "HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
         "HardwareTypeVal" : 1,
         "HaveTimeout" : false,
         "ID" : "01F1",
         "LastUpdate" : "2016-12-05 17:46:40",
         "Name" : "Räknare el abonnemang",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : 7,
         "SubType" : "RFXMeter counter",
         "SwitchTypeVal" : 0,
         "Timers" : "false",
         "Type" : "RFXMeter",
         "TypeImg" : "counter",
         "Unit" : 0,
         "Used" : 1,
         "ValueQuantity" : "",
         "ValueUnits" : "",
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "50"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}

Re: homebridge-edomoticz Plugin

Posted: Monday 05 December 2016 22:50
by madrian
@TheRamon,

thanks for trying it out.

I investigated more: I renamed my lua folder (which means no script is running):

Code: Select all

2016-12-05 22:45:25.782 User: Admin initiated a switch command (31/BEDLED/Set Level)
2016-12-05 22:45:25.786 Error: EventSystem: Error accessing lua script directory /home/madrian/domoticz/scripts/lua/
2016-12-05 22:45:25.783 (LED) Lighting 5 (BEDLED)
2016-12-05 22:45:25.791 User: Admin initiated a switch command (31/BEDLED/On)
2016-12-05 22:45:25.795 Error: EventSystem: Error accessing lua script directory /home/madrian/domoticz/scripts/lua/
Sooo weird. It can't be else, it must be the Domoticz itself.

What version are you using? I am using: Version 3.5837 (October 30th 2016)

I have no other idea. :evil:

Re: homebridge-edomoticz Plugin

Posted: Tuesday 06 December 2016 9:09
by TheRamon
anba wrote:Thanks for your reply.
I don't have a water flow device as the code says. I got three counters and they output the following:
Thank you, will try.

hpapagaj wrote:@TheRamon,

thanks for trying it out.
I investigated more: I renamed my lua folder (which means no script is running):

Sooo weird. It can't be else, it must be the Domoticz itself.

What version are you using? I am using: Version 3.5837 (October 30th 2016)

I have no other idea. :evil:
Whoa, so weird.. Something MUST be interfering. I'm on version 3.6033. (Beta)

Re: homebridge-edomoticz Plugin

Posted: Tuesday 06 December 2016 10:09
by TroisSix
TheRamon wrote:
TroisSix wrote:but where can I find those files? nothing in /var/log, nothing in ~/.homebridge, nothing in ~/homebridge, ...
An idea? :D
Usually, log should be in /var/log/homebridge.log and /var/log/homebridge.err ...
Thanks, but there isn't anything such as homebridge.err or homebridge.log in /var/log
I use "sudo systemctl start homebridge" to start homebridge, but is there a script or config file that we can modify to define where the logs are written? :roll: