Coder Social home page Coder Social logo

thermostat support about pyvera HOT 20 CLOSED

maximvelichko avatar maximvelichko commented on June 22, 2024
thermostat support

from pyvera.

Comments (20)

pavoni avatar pavoni commented on June 22, 2024

Certainly support adding this - but I don't have any connected thermostats.

Would welcome a contribution, and happy to help!

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

thanks. I'm not really a programmer. I can work myself through some python code but i have never actually done any real programming.

Of course I can test the code and give feedback. I guess remote access to my setup could also be provided.

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

@snizzleorg Thanks for the offer. I think adding a thermostat will take some experimenting - so would need to be a developer with local access. Hopefully we'll find someone!

from pyvera.

robjohnson189 avatar robjohnson189 commented on June 22, 2024

I started working on adding thermostat support, It doesn't look like it is going to take too long to get this added. @snizzleorg what kind of thermostat do you have? I'll be developing this to work against a Radio Thermostat CT80. When I paired my thermostat with vera, it shows up as 3 different devices in the Vera Devices page but it seems that I can only really control the thermostat using 1 of those 3...

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

I have danfoss living connect (http://www.pepper1.net/zwavedb/device/426)

not sure which firmware version though. Let me know if I can help somehow...

from pyvera.

robjohnson189 avatar robjohnson189 commented on June 22, 2024

@snizzleorg I've got this working on my end. If you would like to help me test you can install and run my fork of pyvera (https://github.com/robjohnson189/pyvera) and home-assistant (https://github.com/robjohnson189/home-assistant). Let me know how it works. It seems to be working good for me but my thermostat has quite a few more features than yours.

By default home-assistant will load any thermostats as climate components, if you want them loaded into home-assistant as a thermostat you can add the config "climate: thermostat" to your vera config.

@pavoni After a little more testing I'll create a pr

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

@robjohnson189 Thanks!
I'm running a docker image so it's not that easy for me to test. I'll try if I get your branch running in a docker image - hopefully I'll get to it on the weekend.

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

Now added - so closing.

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

@pavoni I still don't see my thermostats. But I was wondering if this is maybe because they show up as heater in vera?
They are Radiator Thermostats (danfoss living connect)
screen shot 2016-10-06 at 09 38 18

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

@snizzleorg Could you have a go at running this code via python?

Use the ip of your controller.

This will list all you devices and their types. Might give us some clues.

Also which vera version are you using?

$ python3
>>> import pyvera
>>> controller = pyvera.VeraController("http://192.168.1.162:3480/")
>>> devices = controller.get_devices()
>>> [(d.name,d.category) for d in devices]

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

Ok I tried:

pip3 install pyvera                                                                                                                                        
Collecting pyvera
  Downloading pyvera-0.2.20-py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): requests>=2.0 in ./.pyenv/versions/3.4.2/lib/python3.4/site-packages (from pyvera)
Installing collected packages: pyvera
Successfully installed pyvera-0.2.20

I get this when I run it:

Python 3.4.2 (default, Jun 15 2015, 19:53:49) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvera
>>> controller = pyvera.VeraController("http://192.168.178.187:3480/")                                                                                                      
>>> devices = controller.get_devices()
>>> [(d.name,d.category) for d in devices]
[('Vera Device 1', ''), ('Vera Device 2', ''), ('Kitchen Radiator', 'Thermostat'), ('Bedroom Radiator R', 'Thermostat'), ('Wall lamp', 'On/Off Switch'), ('Living Radiator R', 'Thermostat'), ('Living Radiator L', 'Thermostat'), ('living motion', 'Sensor'), ('living motion', 'Armable Sensor'), ('Bath Flood Sensor', 'Sensor'), ('Bath Flood Sensor', 'Armable Sensor'), ('Vera Device 18', ''), ('bathroomtemperature2', 'Temperature Sensor'), ('Bathroom Radiator', 'Thermostat'), ('bathtub lamp', 'On/Off Switch'), ('living temperature', 'Temperature Sensor'), ('living luminance', 'Light Sensor'), ('bathroom motion', 'Sensor'), ('bathroom motion', 'Armable Sensor'), ('bathroom temperature', 'Temperature Sensor'), ('bathroom luminance', 'Light Sensor'), ('kitchen motion', 'Sensor'), ('kitchen motion', 'Armable Sensor'), ('kitchen temperature', 'Temperature Sensor'), ('kitchen luminance', 'Light Sensor'), ('kitchen Smoke Sensor', 'Sensor'), ('kitchen Smoke Sensor', 'Armable Sensor'), ('kitchen temperature2', 'Temperature Sensor'), ('office motion', 'Sensor'), ('office motion', 'Armable Sensor'), ('office temperature', 'Temperature Sensor'), ('office luminance', 'Light Sensor'), ('TV', 'On/Off Switch'), ('Bathroom Switch 1', 'On/Off Switch'), ('Bath Ceiling Lamp', 'On/Off Switch'), ('Appliance Module 1', 'On/Off Switch'), ('Bathroom Switch 2', 'On/Off Switch'), ('Bathroom Mirror Lamp', 'On/Off Switch'), ('Appliance Module 2', 'On/Off Switch'), ('Kitchen Switch', 'On/Off Switch'), ('Kitchen Stereo', 'On/Off Switch'), ('Appliance Module 3', 'On/Off Switch'), ('Kitchen Relay', 'On/Off Switch'), ('Appliance Module', 'On/Off Switch'), ('Kitchen Bench Lamp', 'On/Off Switch'), ('Bedroom Switch Livin', 'On/Off Switch'), ('Bedroon Radiator L', 'Thermostat'), ('bedroom motion', 'Sensor'), ('bedroom motion', 'Armable Sensor'), ('bedroom temperature', 'Temperature Sensor'), ('bedroom luminance', 'Light Sensor'), ('hall motion', 'Sensor'), ('hall motion', 'Armable Sensor'), ('Hall Temperature', 'Temperature Sensor'), ('Hall Luminance', 'Light Sensor'), ('Hall Lamp', 'On/Off Switch'), ('Video Projector', 'On/Off Switch'), ('RFID', 'Sensor'), ('RFID', 'Armable Sensor'), ('Door Opener', 'Sensor'), ('Door Opener', 'Armable Sensor'), ('Universal binary input 2', 'Sensor'), ('Universal binary input 2', 'Armable Sensor'), ('Hall Smoke Detector', 'Sensor'), ('Hall Smoke Detector', 'Armable Sensor'), ('scene switch', 'Scene Controller'), ('Bedroom Switch Hall', 'On/Off Switch'), ('bedroom spot', 'On/Off Switch'), ('Appliance Module 5', 'On/Off Switch'), ('Livingroom Stereo', 'On/Off Switch'), ('Office Radiator', 'Thermostat'), ('Kitchen Flood Sensor', 'Sensor'), ('Kitchen Flood Sensor', 'Armable Sensor'), ('Vera Device 77', ''), ('Flood Sensor (temperature)', 'Temperature Sensor')]

So the Thermostats show up as Thermostats...

I seem to also be able to address them

>>> devices[3].set_temperature(20)                                                                                                                                          
>>> devices[3].get_current_goal_temperature()
'20'
>>> devices[3].set_temperature(22)
>>> devices[3].get_current_goal_temperature()
'22'
>>> 

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

So I suppose the problem with home-assistant does not come from pyvera? I'm running home-assistant 29.6 - which is the first version supporting it?

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

That all looks good.

Worth updating to the current HA - just so we know you're using the latest code.

Is there anything interesting in your HA log when HA loads the vera component?

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024
16-10-06 10:21:56 INFO (Thread-1) [homeassistant.loader] Loaded climate.vera from homeassistant.components.climate.vera
16-10-06 10:21:56 INFO (Vera Poll Thread) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.178.187
16-10-06 10:21:56 INFO (Thread-1) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.178.187
16-10-06 10:21:56 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
16-10-06 10:21:56 INFO (Thread-1) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.178.187
16-10-06 10:21:56 ERROR (Thread-1) [homeassistant.components.climate] Error while setting up platform vera
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 107, in _setup_platform
    discovery_info)
  File "/usr/src/app/homeassistant/components/climate/vera.py", line 28, in setup_platform
    device in VERA_DEVICES['climate'])
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 197, in add_entities
    for entity in new_entities:
  File "/usr/src/app/homeassistant/components/climate/vera.py", line 28, in <genexpr>
    device in VERA_DEVICES['climate'])
  File "/usr/src/app/homeassistant/components/climate/vera.py", line 37, in __init__
    VeraDevice.__init__(self, vera_device, controller)
  File "/usr/src/app/homeassistant/components/vera.py", line 131, in __init__
    self.controller.register(vera_device, self._update_callback)
AttributeError: 'NoneType' object has no attribute 'register'
16-10-06 10:21:56 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=vera>
16-10-06 10:21:56 INFO (ThreadPool Worker 3) [homeassistant.loader] Loaded cover from homeassistant.components.cover
16-10-06 10:21:56 INFO (ThreadPool Worker 4) [homeassistant.loader] Loaded lock from homeassistant.components.lock
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_away_mode, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_aux_heat, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_temperature, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_humidity, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_fan_mode, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_operation_mode, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=set_swing_mode, domain=climate>
16-10-06 10:21:57 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=climate>

Updating will be a bit complicated as I'm away for the next weeks... I can update but a couple of times docker made the system hang (during the building of the image) to a state where I had to pull the plug which I can't do remotely...

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

Ok with hass 30.1 they show up. However every Thermostat shows up 2 times. and the Unit is wrong. They work with °C but show up with °F...

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

I think I saw that there was a bug in HA - perhaps home-assistant/core#3605.

As to showing up twice - can you do some detective work on the entity names and the Vera id in HA.

Should probably move the discussion to HA. Feel free to tag me if you want some help.

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

What do you mean by detective work?

Those are the two entities showing up for the same vera ids:

climate.bathroom_radiator:

Heat    Vera Device Id: 20
battery_level: 1%
current_temperature: null
fan_list: On,Auto,Cycle
fan_mode: Auto
friendly_name: Bathroom Radiator
max_temp: 35
min_temp: 7
operation_list: Heat,Cool,Auto Changeover,Off
operation_mode: Heat
temperature: 23.0
unit_of_measurement: °F

climate.bathroom_radiator_2:

Heat    Vera Device Id: 20
battery_level: 1%
current_temperature: null
fan_list: On,Auto,Cycle
fan_mode: Auto
friendly_name: Bathroom Radiator
max_temp: 35
min_temp: 7
operation_list: Heat,Cool,Auto Changeover,Off
operation_mode: Heat
temperature: 23.0
unit_of_measurement: °F

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

Additionally these Thermostats only support Heating, no fan, no cooling etc. also no reporting of the current temperature. Any way to reflect that in hass?

and when I cane the Setpoint I get:

16-10-12 16:03:41 INFO (Vera Poll Thread) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.178.187
16-10-12 16:03:41 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
16-10-12 16:03:41 ERROR (Vera Poll Thread) [pyvera.subscribe] Device Bedroom Radiator R, state 2, Bedroom Radiator R: Waiting for wakeup to send commands
16-10-12 16:03:41 ERROR (Vera Poll Thread) [pyvera.subscribe] Device Bedroom Radiator R, state 2, Bedroom Radiator R: Waiting for wakeup to send commands
16-10-12 16:03:42 INFO (Vera Poll Thread) [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.178.187

Will the command eventually be sent?

from pyvera.

pavoni avatar pavoni commented on June 22, 2024

I can't see anything obvious in the HA code that would cause duplication (the thermostat code looks the same as the switch code). Worth taking a look at your log and config - check if anything is being loaded twice.

Afraid I don't know how the HA climate stuff works - but my Nest also has options (cooling etc) shown that it doesn't support!

from pyvera.

snizzleorg avatar snizzleorg commented on June 22, 2024

home-assistant/core#3849

from pyvera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.