Read British Gas Hive Heating temperature

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by MikeF »

I've recently installed the Hive plugin, which has detected my heating and lights OK, and is regularly updating these (I've set multiplier to 6, so I get updates once a minute). However, I getting the following error several times a day:

Code: Select all

2018-10-16 17:22:08.206 Error: (Hive) 'onHeartbeat' failed 'HTTPError'.
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 594 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 140 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 390 in /home/pi/domoticz/plugins/Hive/plugin.py, function GetDevices
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 163 in /usr/lib/python3.5/urllib/request.py, function urlopen
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 472 in /usr/lib/python3.5/urllib/request.py, function open
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 582 in /usr/lib/python3.5/urllib/request.py, function http_response
2018-10-16 17:22:08.206 Error: (Hive) ----> Line 510 in /usr/lib/python3.5/urllib/request.py, function error
2018-10-16 17:22:08.207 Error: (Hive) ----> Line 444 in /usr/lib/python3.5/urllib/request.py, function _call_chain
2018-10-16 17:22:08.207 Error: (Hive) ----> Line 590 in /usr/lib/python3.5/urllib/request.py, function http_error_default
with the strange effect that it seems to be 'blocking' the Domoticz log. I have numerous RFXCOM devices, which would normally appear in the log at least once a minute, but I'm only seeing scheduled lua events:

Code: Select all

2018-10-16 17:25:00.405 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:30:01.447 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:35:00.584 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:40:00.104 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua
2018-10-16 17:45:00.170 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_SolarSensor1.lua 
This can continue for an hour or more (no regular pattern), before the RFXCOM devices appear again. Checking the log in the GUI for each device, however, shows that these devices are reporting regularly, with no gaps. The same also applies to the Hive devices - these show continuous history.

Any suggestions?
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Hello all,

I recently got my hands on a colour changing bulb and I have implemented support for it in the plugin.

I did have to change the switch type to "dimmer" after I added the device.

Give it a shot if you have any of these and disco to your hearts' content!

https://github.com/imcfarla2003/domoticz-hive

Cheers,

Iain
gnunan
Posts: 4
Joined: Friday 30 November 2018 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan »

Hi,

First of all a big thank you for this plugin.

I am running Domoticz V4.9700 on a Raspberry Pi (Raspbian Jessie) and I have installed Python 3.4.2 (which also matches the version that Domoticz is reporting). I have other Python plugins running successfully, but unfortunately I cannot get the Hive plugin to run - Domoticz either becomes totally unresponsive or else an error appears in the logfile before it has done anything (debug is turned on):

Code: Select all

2018-11-29 22:56:52.464 Status: Domoticz V4.9700 (c)2012-2018 GizMoCuz
2018-11-29 22:56:52.465 Status: Build Hash: a3a45906, Date: 2018-06-23 15:24:51
2018-11-29 22:56:52.465 Status: System: Raspberry Pi
2018-11-29 22:56:52.465 Status: Startup Path: /home/pi/domoticz/
2018-11-29 22:56:52.550 Status: EventSystem: reset all events...
2018-11-29 22:56:52.709 Status: PluginSystem: Started, Python version '3.4.2'.
2018-11-29 22:56:52.727 Status: WebServer(HTTP) started on address: :: with port 8080
2018-11-29 22:56:52.743 Status: WebServer(SSL) started on address: :: with port 443
2018-11-29 22:56:52.747 Status: Proxymanager started.
2018-11-29 22:56:52.749 Status: TCPServer: shared server started...
2018-11-29 22:56:52.750 Status: RxQueue: queue worker started...
2018-11-29 22:56:54.750 Status: (MAC presence) Started.
2018-11-29 22:56:54.751 Status: (NUT UPS monitor) Started.
2018-11-29 22:56:54.751 Status: (Hive heating) Started.
2018-11-29 22:56:54.751 Status: EventSystem: reset all events...
2018-11-29 22:56:54.752 Status: EventSystem: reset all device statuses...
2018-11-29 22:56:54.918 Status: Python EventSystem: Initalizing event module.
2018-11-29 22:56:54.919 Status: EventSystem: Started
2018-11-29 22:56:54.919 Status: EventSystem: Queue thread started...
2018-11-29 22:56:55.653 (Controller) General/Thermostat Clock (Thermostat Clock)
2018-11-29 22:56:55.054 Status: PluginSystem: Entering work loop.
2018-11-29 22:56:55.251 Status: OpenZWave: using config in: /home/pi/domoticz/Config/
2018-11-29 22:56:55.255 Status: OpenZWave: Starting...
2018-11-29 22:56:55.255 Status: OpenZWave: Version: 1.4-2888-g54682370-dirty
2018-11-29 22:56:55.398 Status: (MAC presence) Entering work loop.
2018-11-29 22:56:55.399 Status: (MAC presence) Initialized version 2.0.0, author 'Xorfor'
2018-11-29 22:56:55.570 Status: OpenZWave: Driver Ready
2018-11-29 22:56:55.656 Status: (NUT UPS monitor) Entering work loop.
2018-11-29 22:56:55.656 Status: (NUT UPS monitor) Initialized version 0.2.1, author 'logread'
2018-11-29 22:58:00.932 Error: Hive heating hardware (5) thread seems to have ended unexpectedly
I have stripped out lots of code to try to find out what was wrong and have narrowed it down to the 3 imports from urllib:

Code: Select all

from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
If I comment all of these out then it works, if any of them are uncommented then it fails (N.B. there are no actual urllib calls left in the stripped code). urllib is reported as being urllib3 version 1.9.1 (as installed by apt-get with Python 3.4.2 which is the latest available with apt-get).

I have seen various discussions in this thread about Python 3.4 vs 3.5 but currently there seems to be no problems with either?

However, should I try manually installing Python 3.5.x (and if so which one) or updating urllib or can anyone offer any other suggestions of what may be wrong and what I can try?

Many thanks,

Greg
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Hello,

I have python 3.5.3 installed but I also compile domoticz myself (to keep up with some of the changes in git)
It is quite easy to compile but you need a bit of space for it (roughly 400Mb)

Having said that you could try using plugin.new.py (rename it to plugin.py in lyour Hive folder). I coded this up using the internal domoticz url routines to see if it would work and it seems to but it was not as simple to code. It has not got the latest changes applied to it but I think it should work.

Regards,

Iain
gnunan
Posts: 4
Joined: Friday 30 November 2018 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan »

Hi Iain,

Thanks for your reply and sorry it took so long to get back to you.

I decided that the best way to proceed was to update the Pi to latest Raspbian. Unfortunately that took me down a rabbit hole of upgrade woes. Even ethernet stopped working. By the time I got that going it was clear that most other things had been broken too, including OpenZWave, so I decided to do a clean install but still OpenZWave was broken. It's taken me days to find the problem. Despite all the install guides only saying that a Pi 3 needed it for RazBerries, and a Pi 2 not having bluetooth, it turns out that you need a "dtoverlay=pi3-disable-bt" in /boot/cmdline.txt :cry:

So, I now have the Hive plugin going (thanks) using Python 3.5.3 on the stock Domoticz V4.9700 but I have the following errors in the log on start-up:

Code: Select all

Error: (Hive heating) 'onStart' failed 'UnboundLocalError':'local variable 'foundOutsideDevice' referenced before assignment'.
Error: (Hive heating) ----> Line 655 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
Error: (Hive heating) ----> Line 54 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
Error: (Hive heating) ----> Line 167 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
and on every heart beat :

Code: Select all

Error: (Hive heating) 'onHeartbeat' failed 'UnboundLocalError':'local variable 'foundOutsideDevice' referenced before assignment'.
Error: (Hive heating) ----> Line 676 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
Error: (Hive heating) ----> Line 167 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
and no Outside temperature device seems to be created.

Also I have a 3 zone Hive heating system but it is only showing me 1 zone and hot water. Is this an unimplemented feature?

Many thanks again,

Greg.
gnunan
Posts: 4
Joined: Friday 30 November 2018 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan »

Hi,

For the record I spoke slightly too soon. The above "dtoverlay=pi3-disable-bt" in /boot/cmdline.txt fix worked for (earlier versions of) Jessie, but not for Stretch. For stretch you need to follow the instructions in Detailed installation instructions RazBerry2 and Pi3 even for a Pi 2.

Greg
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Greg,

More than one thermostat is not currently supported - I think the code is ready to take it but I need to see the device layout.

Can you run the latest version of collect_json.py and post a link to somewhere I can get it? Or put it here:
https://github.com/imcfarla2003/domoticz-hive/issues/2

Can you also try the latest version of the plugin (0.7) which should fix the issue with the outside temperature.

Regards,
Iain
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

All - Version 0.7 of the plugin now supports cool to warm white lights
gnunan
Posts: 4
Joined: Friday 30 November 2018 16:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by gnunan »

Hi Iain,

As requested I've left the output that I got from your latest (as at 14/12/18) collect_json.py in https://github.com/imcfarla2003/domoticz-hive/issues/2 for you.

I have 3 heating zones - "Gnd Floor", "Mid Floor" and "Top Floor". The hot water is associated with "Gnd Floor" if that is relevant/helpful.

Many thanks,

Greg.
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Greg,

Can you try the latest commit please?

Iain
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by mark.sellwood »

I.n testing on Domoticz V4.10300 and see the following:
2018-12-20 08:44:48.285 Status: (Hive) Initialized version 0.9(Dev), author 'imcfarla, MikeF and roadsnail'
2018-12-20 08:44:48.299 Status: (Hive) Entering work loop.
2018-12-20 08:44:49.225 Error: (Hive) 'onStart' failed 'KeyError'.
2018-12-20 08:44:49.225 Error: (Hive) ----> Line 792 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function onStart
2018-12-20 08:44:49.225 Error: (Hive) ----> Line 73 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function onStart
2018-12-20 08:44:49.225 Error: (Hive) ----> Line 179 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function onHeartbeat
2018-12-20 08:44:49.226 Error: (Hive) ----> Line 344 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function UpdateDeviceState
2018-12-20 08:44:49.226 Error: (Hive) ----> Line 282 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function GetThermostatUI
2018-12-20 08:44:59.184 Error: (Hive) 'onHeartbeat' failed 'KeyError'.
The errors repeat every 10 seconds and no devices are created.

Am I missing something?
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by MikeF »

Have you checked ‘Accept new hardware devices’ in Settings?
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Can you also run collect_json.py from here: https://github.com/imcfarla2003/domotic ... ct_json.py , create an issue on github and attach the output there please?
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by mark.sellwood »

Accept new hardware devices is enabled.
I have run collect_json.py and opened a new issue on Github
Thanks
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
johnnyutah
Posts: 13
Joined: Wednesday 28 March 2018 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by johnnyutah »

Latest version has completely broken it for me.

All i get is this error repeated every minute...

Error: CConnection_connect, connect request from 'Hive' ignored. Transport is connected

Any ideas what could be causing this?
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Hello,

Try using the plugin.urlib.py (rename it to plugin.py) and see if that helps for now.
The connection framework in domoticz is not playing nicely!

Regards,
johnnyutah
Posts: 13
Joined: Wednesday 28 March 2018 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by johnnyutah »

Tried that one and get the following...

2019-01-18 15:16:27.933 Error: (Hive) 'onStart' failed 'KeyError'.
2019-01-18 15:16:27.934 Error: (Hive) ----> Line 836 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
2019-01-18 15:16:27.934 Error: (Hive) ----> Line 85 in /home/pi/domoticz/plugins/Hive/plugin.py, function onStart
2019-01-18 15:16:27.934 Error: (Hive) ----> Line 191 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2019-01-18 15:16:27.934 Error: (Hive) ----> Line 619 in /home/pi/domoticz/plugins/Hive/plugin.py, function UpdateDeviceState
2019-01-18 15:16:36.522 Error: (Hive) 'onHeartbeat' failed 'KeyError'.
2019-01-18 15:16:36.523 Error: (Hive) ----> Line 857 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2019-01-18 15:16:36.523 Error: (Hive) ----> Line 191 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2019-01-18 15:16:36.523 Error: (Hive) ----> Line 464 in /home/pi/domoticz/plugins/Hive/plugin.py, function UpdateDeviceState
2019-01-18 15:16:46.147 Error: (Hive) 'onHeartbeat' failed 'KeyError'.
2019-01-18 15:16:46.148 Error: (Hive) ----> Line 857 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2019-01-18 15:16:46.148 Error: (Hive) ----> Line 191 in /home/pi/domoticz/plugins/Hive/plugin.py, function onHeartbeat
2019-01-18 15:16:46.148 Error: (Hive) ----> Line 464 in /home/pi/domoticz/plugins/Hive/plugin.py, function UpdateDeviceState

I've disabled it for now. I'll keep an eye out for any progress on Github.

Thanks for your help anyway.
imcfarla
Posts: 64
Joined: Monday 04 December 2017 13:18
Target OS: Linux
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by imcfarla »

Interesting. Can you open a new ticket on github and attach the results of collect_json.py please?
johnnyutah
Posts: 13
Joined: Wednesday 28 March 2018 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Read British Gas Hive Heating temperature

Post by johnnyutah »

imcfarla wrote: Friday 18 January 2019 23:43 Interesting. Can you open a new ticket on github and attach the results of collect_json.py please?
I've done as you asked, thanks.
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Read British Gas Hive Heating temperature

Post by mark.sellwood »

I get the same error

Code: Select all

2019-01-26 14:04:19.060 Error: (Hive): Async Secure Read Exception: 1, stream truncated
2019-01-26 14:04:19.309 Error: (Hive) 'onMessage' failed 'KeyError'.
2019-01-26 14:04:19.309 Error: (Hive) ----> Line 860 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function onMessage
2019-01-26 14:04:19.309 Error: (Hive) ----> Line 155 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function onMessage
2019-01-26 14:04:19.309 Error: (Hive) ----> Line 481 in '/home/pi/domoticz/plugins/domoticz-hive/plugin.py', function UpdateDeviceState
2019-01-26 14:04:19.310 Error: (Hive): Async Secure Read Exception: 1, stream truncated
Domoticz V4.10365
Python version '3.5.3
Also the memory usage increases.

Pi rebooted at around 09:00, plugin disabled around 21:00
Attachments
Memory Test.JPG
Memory Test.JPG (36.98 KiB) Viewed 1829 times
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest