The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
[NEW UPDATE] Plugwise-2-py (v2.0.4)
Plugwise-2-py
Homey app to connect plugwise circles via Plugwise-2-py. This tool, developed by Seven Watt, can be used as an alternative for Plugwise Source. It runs on all devices that support python, such as your NAS or a raspberry pi.
Homey functionality
Device Card in browser and on mobile app:
- Switch on or off
- See real-time power usage (Watts, 8 seconds average)
- See total power meter of circle (kWh)
Insights:
- Switched on or off
- Power usage (W, production is negative Watts)
- Power meter (kWh)
Trigger Flow Cards:
- Switched on or off
- Power usage change
- Power meter change
Condition Flow Cards:
- Switched on or off
Action Flow Cards:
- Switch on or off
- Toggle on or off
Setting up the PW2PY server
A manual for setting it up on a rpi is provided on Plugwise-2-py.
To make it work properly with Homey you must do some base settings within PW2PY:
- Enable 10-seconds monitoring: this should be enabled
- Enable logging form Circle internal metering buffers: this should be enabled
- Log interval: I advise to set this to 60 minutes
- Schedules: can be used to switch a circle to powersaving mode automatically
- Always on: enable this for circles that must not be switchable from Homey
- Production: enable this for circles that measure production (e.g. solar panel)
Setting up Homey
After setting up PW2PY you can configure Homey to connect to it. Go to the app settings screen and enter the IP address of the PW2PY-MQTT server that you are using. Circles can then be added through the Devices tab of Homey. After pairing a circle you can set the polling interval per circle in the device settings (minimum 10 seconds).
Donate:
If you like the app you can show your appreciation by posting it in the forum. If you really like it you can buy me a beer, or coffee, or whatever you like
===============================================================================
Version changelog
v2.0.4 2018.04.07 MQTT update v2.17.0. Log module added. Stability improvements.
v2.0.3 2018.01.14 Security fix (mqtt module)
v2.0.2 2017.11.25 Hotfix for Homey fw 1.5.6
v2.0.0 2017.11.15 Complete code rewrite to SDK V2
v1.0.0 2016.12.04 MQTT client updated to v2.1.3. Minor code changes
v0.0.1 2016.09.30 Initial release
Comments
It worked for a few hour, now I get this error message:
SyntaxError: Unexpected end of input
at Object.parse (native)
at MqttClient.<anonymous> (/drivers/circle/driver.js:58:31)
at emitThree (events.js:97:13)
at MqttClient.emit (events.js:175:7)
at MqttClient._handlePublish (/node_modules/mqtt/lib/client.js:806:12)
at MqttClient._handlePacket (/node_modules/mqtt/lib/client.js:286:12)
at process (/node_modules/mqtt/lib/client.js:242:12)
at Writable.writable._write (/node_modules/mqtt/lib/client.js:252:5)
at doWrite (/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:319:64)
at writeOrBuffer (/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:308:5)
Exit code: 1
I saw your pull request for empty message from MQTT. If this solves it for you I will change that. I must say I don't get empty messages from MQTT. Maybe you should check your MQTT setup (or wifi connection maybe?)
(Haven't used the circles for a long time, but most of them are still plugged in)
Never mind, I already found it in the Module-details.
For the circles I own I just had to put '000D6F0000' or '000D6F0001' in front of the 6 hex digits that are printed on the label of the circle.
in the Module-details of the Plugwise-Source, I found :
Magnetron 000D6F0000469F6C Circle+
V2.0.0 is available in the appstore now.
Have fun and let me know if you like the app!
And are you on the latest version mqtt and pw2py on the server side?
I did test the migration myself as far as I could, but there might be very old settings in your Homey. If all else fails you might have to delete and reinstall the app.
I do have v2.0.0 running without any issues myself for a week now, so I know it is pretty stable...
The log has been sent to the developer.
The unique log ID is: d783c9f9-74ea-4974-9171-6b73999bde74
Several stability improvements were implemented and a log module was added for debugging and general event log.
Please send me the logs (pw2py app settings).
I hope that helps me in pinpointing the cause. (I dont have these crashes myself....)
2018-04-19 15:45:00 [log] [ManagerDrivers] [circle] switching off: 000D6F00003FD43F waterkoker
2018-04-19 15:44:23 [log] [ManagerDrivers] [circle] switching on: 000D6F00003FD43F waterkoker
2018-04-19 15:43:43 [log] [ManagerDrivers] [circle] switching off: 000D6F00003FD43F waterkoker
2018-04-19 15:42:55 [log] [ManagerDrivers] [circle] switching on: 000D6F00003D4F9E koelkast
2018-04-19 15:42:21 [log] [ManagerDrivers] [circle] switching off: 000D6F00003D4F9E koelkast
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] mqtt subscription ok: [{"topic":"plugwise2py/state/circle/#","qos":0},{"topic":"plugwise2py/state/energy/#","qos":0}]
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] mqtt connection ok: {"cmd":"connack","retain":false,"qos":0,"dup":false,"length":2,"topic":null,"payload":null,"sessionPresent":false,"returnCode":0}
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [8] device init socket 000D6F00003D4F15 cv-ketel
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [7] device init socket 000D6F00003FE434 vriezer
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [6] device init socket 000D6F00003D4F3C wasmachine
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [5] device init socket 000D6F00003FD43F waterkoker
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [4] device init socket 000D6F00003FE459 keukenboiler
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [3] device init socket 000D6F00003FD8FE vaatwasser
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [2] device init socket 000D6F0000469F6C magnetron
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [1] device init socket 000D6F00003FE455 senseo
2018-04-19 15:38:51 [log] [ManagerDrivers] [circle] [0] device init socket 000D6F00003D4F9E koelkast
2018-04-19 15:38:50 [log] [ManagerDrivers] [circle] Pw2pyDriver onInit
2018-04-19 15:38:50 [err] [settingsBackend] error reading logfile: ENOENT: no such file or directory, open '/userdata/log.json'
2018-04-19 15:38:50 [log] [settingsBackend] capturing stderr
Can it be that there is to many data logged from the circles? I'm using a Pi-3
My pi3 is connected through wifi, and basically doing only pw2py. Did you do a full fresh raspbian install? Unfortunately I dont know much about raspbian/linux/python etc. So I cannot really help you there. Maybe SevenW can help you? https://github.com/SevenW/Plugwise-2-py
Just did a reboot of the Pi and this is logged:
2018-04-20 19:38:36 [log] [ManagerDrivers] [circle] switching off: 000D6F00003D4F9E koelkast
2018-04-20 19:38:18 [log] [ManagerDrivers] [circle] switching on: 000D6F00003D4F9E koelkast
2018-04-20 19:23:14 [log] [ManagerDrivers] [circle] mqtt subscription ok: []
2018-04-20 19:23:14 [log] [ManagerDrivers] [circle] mqtt connection ok: {"cmd":"connack","retain":false,"qos":0,"dup":false,"length":2,"topic":null,"payload":null,"sessionPresent":false,"returnCode":0}
2018-04-20 19:23:14 [log] [ManagerDrivers] [circle] client is trying to reconnect
2018-04-20 19:23:04 [log] [ManagerDrivers] [circle] client closed (disconnected)
2018-04-20 19:22:34 [log] [ManagerDrivers] [circle] client is trying to reconnect
2018-04-20 19:22:24 [log] [ManagerDrivers] [circle] client closed (disconnected)
2018-04-20 19:22:24 [log] [ManagerDrivers] [circle] mqtt broker is offline
Looks good, but the circle is not switching ON/OFF, so your App is running fine and keeps running.
When I run: tail -f /home/pi/pwlog/pw-logger.log on the Pi, the latest 10 lines of yesterday are shown from the file pw-logger.log