RJ / heatmiser-neohub.py

Python library to talk the direct-lan-api to control a Heatmiser Neohub / Neostats - and home-assistant component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support for neoAir?

hsleewis opened this issue · comments

Hi,

Would it be possible to also support neoAirs?
And is it possible to set degrees at with decimals through the API?

Thanks!

i don't have any neoAirs, so have only been able to test with the neohub and mesh networked neostats.

as far as i'm aware, the neoAir also talks to the neohub, so it should be possible to add support with minimal code changes. i can't test it though.

what do you mean about decimals?

Hi There - I was really excited to find this project.
my thermostats are Neostat 12V types, which report themselves as DEVICE_TYPE 12, so the code does not work "out of the box".
But I changed the permitted values in Neohub.py to include 12 (as well as 1 and 6, as I also have Neoplugs") - and that seems to work for the stats.
Now .\neostat list from the command line lists correctly the devices (including id Nos, Temp & Name for the stats, and status for the plugs).











".\neocli frost_off "Back Bedroom"" and ".\neocli frost_on "Back Bedroom" seem to work as intended.

My problem is that ".\neocli switch-on "House Plug"" doesn't seem to have any effect

Do you have any suggestion where I might start to look for a solution.

Any suggestions gratefully received.

All I want to do is switch on/off the neoplug from within a python program.
Can you help with the syntax?

Thanks

Hi @JohnRaynor

Did you try switch_on with underscore, not -? eg:

neocli.py switch_on "House Plug"

Hi.

Thanks for responding so quickly.
I apologise for the typo - I meant "switch_on", of course.

I eventually tied down the problem to an error in the "switch_on" and "switch_off" lines in neocli.py.
The closing parenthesis of the "await" statement should be moved from after "neoplugs()" to the end of the line.

It all works fine now (I was using a similar line in my calling python program)

I now have a fully functional raspberry-pi(zero-W)-powered temperature sensor in my greenhouse, wirelessly controlling the temperature to within half a degree, using your library to control a fan heater through a neoplug. Works great.

Thanks again.

Ah, well spotted - must have broken that when i refactored the cli script.
Have committed a fix, thanks.

Glad you got everything working 👍🏼

Fantastic work. Thanks so much for this. I own a Neo air and it seems to work perfectly with the following change to neohub.py:
elif merged["DEVICE_TYPE"] == 7: if name not in self._neostats: self._neostats[name] = NeoStat(self, name)

So far I have only tried list from neocli.py but more than happy to test out anything else you like.

Just to add to this, the same applies to NeoStat v2. The updates I've added to my local copy are:

# device type 1 = neostat
            #             6 = neoplug
            if merged["DEVICE_TYPE"] == 0:
                # offline therm?
                pass
            elif merged["DEVICE_TYPE"] == 1:
                if name not in self._neostats:
                    self._neostats[name] = NeoStat(self, name)
            elif merged["DEVICE_TYPE"] == 6:
                if name not in self._neoplugs:
                    self._neoplugs[name] = NeoPlug(self, name)
            elif merged["DEVICE_TYPE"] == 7:
                if name not in self._neoplugs:
                    self._neoplugs[name] = NeoStat(self, name)
            elif merged["DEVICE_TYPE"] == 12:
                if name not in self._neoplugs:
                    self._neoplugs[name] = NeoStat(self, name)
            else:
                logging.warn("Unimplemented NeoSomething device_type(%s)! "
                             "Only support neostat(1) and neoplug(6) at the mo" % (merged["DEVICE_TYPE"]))
                print(repr(merged))
                pass

Output is now

<NeoStat id=1  temp=20.9 frost=False name='Landing'>
<NeoStat id=3  temp=20.9 frost=False name='Living Room'>
<NeoStat id=4  temp=21.6 frost=False name='Garage'>
<NeoStat id=5  temp=21.5 frost=False name='Conservatory'>

Hi @RJ Firstly thanks for the code never programmed in python before but your code was really useful in getting an understanding how the neoHub works. I had some initial problems as the zigbee mesh network kept dropping some of my neoAirs and then all of them would go off line. I originally just wanted to create a soft reboot command e.g. {"RESET":0}^@ when the program identified offline neoAir device. This seemed to work but not all the time so I bought a new neoPlug, fortunatley or unfortunatley this solved my problem so the neoAirs havnt gone offline for about 5 days now. Sorry to go on! I have added neoAirs basically just a copy initially of your neoStat code and a reboot this seems to work OK. I added offline command and this should identify offline devices and I have implemented a reboot neoHub command happy to share this in a development branch if you have one with a pull request, anyway thanks for the code.

neocli.py list
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:root:Querying NeoHub for all device data
<NeoAir id=1 temp=20.9 frost=False name='Lounge' 'Online'>
<NeoAir id=3 temp=21.4 frost=False name='Alans Study' 'Online'>
<NeoAir id=5 temp=20.8 frost=False name='Downstairs Hall' 'Online'>
<NeoAir id=7 temp=19.4 frost=False name='Cloakroom' 'Online'>
<NeoAir id=9 temp=19.6 frost=False name='Utility Room' 'Online'>
<NeoAir id=11 temp=20.4 frost=False name='Master Bedroom' 'Online'>
<NeoAir id=13 temp=19.2 frost=False name='Master Bedroom Ensuite' 'Online'>
<NeoAir id=16 temp=20.6 frost=False name='Alasdairs Bedroom ' 'Online'>
<NeoAir id=18 temp=20.2 frost=False name='Main Bathroom' 'Online'>
<NeoAir id=20 temp=20.9 frost=False name='Store Room' 'Online'>
<NeoAir id=22 temp=20.6 frost=False name='Alasdairs Ensuite' 'Online'>
<NeoAir id=24 temp=21.1 frost=False name='Kitchen Dinning Room' 'Online'>
<NeoAir id=26 temp=21.2 frost=False name='Wendys Study' 'Online'>

<NeoPlug id=15 status=OFF name='Hallway Repeater' 'Online'>
<NeoPlug id=28 status=OFF name='Wendys Study Plug Repeater' 'Online'>