Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm plugin -> hkr_device -> set_temperature #301

Closed
giase82 opened this issue Dec 3, 2019 · 7 comments
Closed

avm plugin -> hkr_device -> set_temperature #301

giase82 opened this issue Dec 3, 2019 · 7 comments

Comments

@giase82
Copy link

giase82 commented Dec 3, 2019

Hi,

Thanks a lot for this plugin, very helpful!

I am trying to integrate my Fritz!Dect 301 Thermostat, and am using the hkr_device-functionality. Reading state and temperature works fine, however, I would like to be able to set the set_temperature. It seems this is currently not supported?

Could this be added?

Best regards,
//giase

@giase82 giase82 changed the title hkr_device -> set_temperature avm plugin -> hkr_device -> set_temperature Dec 3, 2019
@aschwith
Copy link
Contributor

aschwith commented Dec 3, 2019

Hi,
setting the set_temperature is already implemented but not released yet to the master branch. Just use the pluging from the develop branch:
https://github.com/smarthomeNG/plugins/tree/develop/avm

@aschwith aschwith closed this as completed Dec 3, 2019
@giase82
Copy link
Author

giase82 commented Dec 4, 2019

Hi,

I just tried that out but it hasn't been successful. I tried setting the set_temparature with Visu (and from the Admin-page), but with every "update-loop" the previously set value is overwritten. So it seems it is not written into the thermostat. Please see the log-extract and config below.

I'd be glad to receive hints and would be happy to test!

//giase

log:

-> setting settemp via Visu
2019-12-04 11:32:52 CET DEBUG    item              Main         Item avm.dect.bad_eg_heizkoerper.settemp = 22.5 via Visu 192.168.1.211:59940 None  --  (item.py:__update:2224)
...

-> update loop resets value to the one stored in Fritz!DECT 301
2019-12-04 11:36:51 CET DEBUG    __init__          plugins.avm_fritzbox_6490.update fritzbox_6490@: Starting update loop for instance fritzbox_6490  --  (__init__.py:_update_loop:637)
...
2019-12-04 11:36:55 CET DEBUG    __init__          plugins.avm_fritzbox_6490.update fritzbox_6490@: handling hkr device  --  (__init__.py:_update_home_automation:1781)
2019-12-04 11:36:55 CET DEBUG    item              plugins.avm_fritzbox_6490.update Item avm.dect.bad_eg_heizkoerper.settemp = 23.0 via avm None None  --  (item.py:__update:2224)

config:

        bad_eg_heizkoerper:
            # Current hkr state: 0 = closed, 1: open, 2: temperature controlled, 3: error
            type: num
            value: 3
            avm_data_type@fritzbox_6490: hkr_device
            ain: XXXXX XXXXXXX # has to be identical to id in fritzbox (also with spaces!)
            visu_acl: rw

            # these items need to be child items from hkr_device
            temp:
                value: -1
                avm_data_type@fritzbox_6490: temperature
                type: num
                visu_acl: rw

            settemp:
                visu_acl: rw
                type: num
                database: 'yes'
                value: -1
                avm_data_type@fritzbox_6490: set_temperature

@giase82
Copy link
Author

giase82 commented Dec 4, 2019

I found a hint in the warnings-log:

2019-12-04  12:02:49 ERROR    plugins.avm         fritzbox_6490@: Exception when sending POST request for updating item towards the FritzDevice: HTTPSConnectionPool(host='fritz.box', port=443): Max retries exceeded with url: /webservices/homeautoswitch.lua?ain=099950347481&switchcmd=sethkrtsoll&param=45.0&sid=c59f7253a7121d95 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x69b1ecf0>: Failed to establish a new connection: [Errno 111] Verbindungsaufbau abgelehnt',))

Do you have an idea what is wrong? Why can I read but not set? User-permissions in the FB?

//giase

@giase82
Copy link
Author

giase82 commented Dec 4, 2019

Hi again,

I figured if I reset my FritzBox to use the standard 443 port, it works. I am confused as reading the temp is working also before. How is the port for the FB-interface for the plugin derived? e.g. if I use the standard FritzBox-port 443, the plugin port is 49433. What if I e.g. use port 44450?

//giase

@psilo909
Copy link
Contributor

psilo909 commented Dec 4, 2019

49443 is the standard HTTPS tr-064 port (e.g. https://www.janrufmonitor.de/tr-064-aktivieren/, https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_TR-064_first_steps.pdf -> Chapter 3.1)
please ask AVM how to change that and not us. if it is possible to change it at all!

@giase82
Copy link
Author

giase82 commented Dec 4, 2019

I just meant to say: If someone does NOT use the standard HTTPS port for security reasons in the FB (as I did), the avm-plugin won’t work as expected. This should be helpful information for you as well.
In addition, it might be confusing to allow setting the port in the plugin to an arbitrary value as this implies that this should work.

This particular problem here can be solved setting the standard https-port in the FB.

Cheers!

@psilo909
Copy link
Contributor

psilo909 commented Dec 4, 2019

it is ok to switch the port between http and https. so at least for this it is mandatory to have it configurable.

i cannot say how TR-064 will react if you reconfigure 443. but i suppose there is a solution as AVM is also using their TR-064 interface. if they did not regard a changed 443, this could be also a bug in the fritzbox, but its not upon me to judge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants