JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
194 stars 42 forks source link

Not able to get readings from miniserver #126

Closed danielvancamp closed 2 years ago

danielvancamp commented 2 years ago

First of all, thanks a lot for the effort you put into making and maintaining this. I'm rather new to Home Assistant, but with the integration of Loxone i think i'll never go back to the Loxone GUI again. 😍

Which Model do you use from loxone? Miniserver? Gen1 or Gen2? Gen1

Which software version does your loxone use? 13.0.7.26

How did you install HomeAssistant? Over Hassio oder manual install? Docker container (linuxservers)

Which Version do you use of HomeAssistant? Home Assistant 2022.7.7

Describe the bug Installed PyLoxone through HACS which went like a charm. When configuring my server, it detects all my entities but after finishing up it throws me 2 errors. image image

I've checked countless things already, but like i mentioned already, i just started using Home Assistant so not sure what is going wrong here. I've written a small nodeJS server which connects to loxone through a WS with the same creds, so i'm positive the creds do work. I would also assume the same since it did connect to the miniserver and fetched all the entities.

I'm probably missing something obvious, sorry if this is the case.

Hope you find the time to have a look at this.

Paste the error log with the following settings:

Logger: custom_components.loxone.miniserver
Source: custom_components/loxone/miniserver.py:106
Integration: PyLoxone ([documentation](https://github.com/JoDehli/PyLoxone), [issues](https://github.com/JoDehli/PyLoxone/issues))
First occurred: 7:04:29 PM (1 occurrences)
Last logged: 7:04:29 PM

Error connecting to loxone miniserver #1
Logger: homeassistant.components.binary_sensor
Source: helpers/entity_platform.py:164
Integration: Binary sensor ([documentation](https://www.home-assistant.io/integrations/binary_sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+binary_sensor%22))
First occurred: 7:04:29 PM (1 occurrences)
Last logged: 7:04:29 PM

The loxone platform for the binary_sensor integration does not support platform setup. Please remove it from your config.

Let me know if you need any additional information.

Kind regard! Daniel

JoDehli commented 2 years ago

@danielvancamp do you have configured your loxone via yaml? If so remove it and configure via GUI.

Or do you have any custom sensor defined via yaml? If so remove it and try it again.

danielvancamp commented 2 years ago

Hello @JoDehli, good morning! Thanks for you reply.

I installed it through the GUI. No custom sensors are installed, however i have one custom service(?) configured in the configuration.yaml.

This is my current configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

rest_command:
  ring:
    url: http://192.168.1.35/api/sonos/ring

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

We are talking about the configuration.yaml right? :D

Update Just tried without the custom service(?) ring but still didn't solve the issue.

Maybe i configured some strange things in loxone itself which is not supported? Although i can't think of what i could be.

JoDehli commented 2 years ago

@danielvancamp the ring should not be the problem. I do not know at moment what could be the problem. Sorry.

How did you install pyloxone? Is it the newest pyloxone?

danielvancamp commented 2 years ago

@JoDehli no worries! I'll try to dig a little deeper in the coming days. I installed it through HACS, currently i'm on the latest version 0.3.13, i tried with some previous versions as well, no success there either :(

I'll try to run an clean setup and see if i get it running like that!

JoDehli commented 2 years ago

@danielvancamp the binary sensors an introduced maybe 2 versions ago. The error massage comes from the binary sensor. So try the version before. But remove the loxone custom components folder manually. I had some problems by downgrading over hacs. I do no know why but it did not downgrade over hacs.

JoDehli commented 2 years ago

@danielvancamp you can try it with special log output. Maybe we can find out what went wrong. Add this to your configuration.yaml

logger:
  default: warning
  logs:
    homeassistant: warning
    homeassistant.helpers: warning
    custom_components.loxone: debug
    custom_components.loxone.api: debug

Maybe it is the token safe because you are on docker.

danielvancamp commented 2 years ago

@JoDehli i'll try both your comments today when I get home and keep you posted! Thanks for the possible approached already, looking forward to trying those :D

danielvancamp commented 2 years ago

I see some extra logs now! Seems indeed to be something with the token which throws an error?

2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] error save_token...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] tokenpath: /config/.homeassistant/lox_token.cfg

Full logs here!

2022-08-03 08:38:52 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration loxone which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-03 08:42:56 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration loxone which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone sensor...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone binary_sensor...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone switch...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone cover...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone light...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone climate...
2022-08-03 08:43:58 DEBUG (MainThread) [custom_components.loxone] starting loxone alarm_control_panel...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] try to read token
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] try to get_token_from_file
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] try to get public key: http://192.168.1.240:666/jdev/sys/getPublicKey
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] get_public_key successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] init_rsa_cipher successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] generate_session_key successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] parse_loxone_message successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] acquire_tokend
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] get_new_aes_chiper successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] parse_loxone_message successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] hash_credentials successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] get_new_aes_chiper successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] parse_loxone_message successfully...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] error save_token...
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.api] tokenpath: /config/.homeassistant/lox_token.cfg
2022-08-03 08:44:03 ERROR (MainThread) [custom_components.loxone.miniserver] Error connecting to loxone miniserver #1
2022-08-03 08:44:03 ERROR (MainThread) [homeassistant.components.binary_sensor] The loxone platform for the binary_sensor integration does not support platform setup. Please remove it from your config.
2022-08-03 08:44:03 DEBUG (MainThread) [custom_components.loxone.climate] Input: {'name': 'Intelligent Room Controller', 'type': 'IRoomControllerV2', 'uuidAction': '14b44e00-0178-b724-ffff189032db279d', 'room': 'Speelkamer', 'cat': 'Heating', 'defaultRating': 2, 'isFavorite': True, 'isSecured': False, 'details': {'jLockable': True, 'timerModes': [{'name': 'Comfort temperature', 'description': 'Comfort', 'id': 1}, {'name': 'Eco temperature', 'description': 'Saving Mode', 'id': 0}, {'name': 'Off (building protection)', 'description': 'Building protection', 'id': 2}], 'format': '%.1f°', 'connectedInputs': 0, 'possibleCapabilities': 1}, 'states': {'jLocked': '94b44e00-0178-b702-ffffb569f58b8afe', 'tempActual': '14b44e00-0178-b6fc-ffffb569f58b8afe', 'tempTarget': '14b44e00-0178-b722-ffffb569f58b8afe', 'comfortTemperature': '14b44e00-0178-b704-ffffb569f58b8afe', 'comfortTemperatureCool': '1837ec41-0249-fdcb-ffff33969bae0483', 'comfortTolerance': '14b44e00-0178-b705-ffffb569f58b8afe', 'absentMinOffset': '14b44e00-0178-b706-ffffb569f58b8afe', 'absentMaxOffset': '14b44e00-0178-b707-ffffb569f58b8afe', 'frostProtectTemperature': '14b44e00-0178-b708-ffffb569f58b8afe', 'heatProtectTemperature': '14b44e00-0178-b709-ffffb569f58b8afe', 'shadingCoolTemp': '1837ec41-0249-fdd0-ffff33969bae0483', 'shadingHeatTemp': '1837ec41-0249-fdcf-ffff33969bae0483', 'actualOutdoorTemp': '172c2161-0175-fb70-ffffc40db8d02e4f', 'currentMode': '14b44e00-0178-b71f-ffffb569f58b8afe', 'shadingOut': '14b44e00-0178-b71e-ffffb569f58b8afe', 'activeMode': '14b44e00-0178-b6f6-ffffb569f58b8afe', 'comfortTemperatureOffset': '14b44e00-0178-b6f1-ffffb569f58b8afe', 'overrideEntries': '14b44e00-0178-b6f2-ffffb569f58b8afe', 'prepareState': '14b44e00-0178-b6f3-ffffb569f58b8afe', 'useOutdoor': '14b44e00-0178-b6f4-ffffb569f58b8afe', 'operatingMode': '14b44e00-0178-b6f7-ffffb569f58b8afe', 'overrideReason': '14b44e00-0178-b6f9-ffffb569f58b8afe', 'excessEnergyTempOffset': '172c2161-0175-fb95-ffff189032db279d', 'averageOutdoorTemp': '172c2161-0175-fb96-ffff189032db279d', 'temperatureBoundaryInfo': '172c2161-0175-fb97-ffff189032db279d', 'capabilities': '1837ec41-0249-fdef-ffff189032db279d', 'openWindow': '14b44e00-0178-b6fd-ffffb569f58b8afe', 'modeList': '14b44e00-0178-b6f8-ffffb569f58b8afe'}, 'subControls': {'14b44e00-0178-b6f0-ffffb569f58b8afe': {'name': 'Heating and Cooling', 'type': 'IRCV2Daytimer', 'uuidAction': '14b44e00-0178-b6f0-ffffb569f58b8afe', 'defaultRating': 0, 'isFavorite': False, 'isSecured': False, 'details': {'analog': True, 'format': '%.1f°'}, 'states': {'entriesAndDefaultValue': '14b44e00-0178-b6f0-ffffb569f58b8afe', 'mode': '14b44e00-0178-b723-ffffb569f58b8afe', 'modeList': '14b44e00-0178-b6f8-ffffb569f58b8afe', 'value': '14b44e00-0178-b6f6-ffffb569f58b8afe', 'needsActivation': '1837ec41-0249-fdee-ffff189032db279d'}}}, 'hass': <homeassistant.core.HomeAssistant object at 0x7f5435b82e90>, 'hvac_auto_mode': 0}
JoDehli commented 2 years ago

@danielvancamp does the token safe path exist on your system? If not maybe you can try to make this shared folder on your docker installation and try again until the error is gone.

To safe the token on the file system is not the best way I know. Maybe I can shift it to the home assistant config itself. This would be the best way to support all platforms and installation methods.

danielvancamp commented 2 years ago

@JoDehli That was it!

image image

Thank you very much for your assistance! 😍 I can now start to do all crazy things with loxone and home assistant.

Solution

Create the folder .homeassistant in your docker volume where the token can be stored is the solution to this problem.

bruecktech commented 2 years ago

I have the same error message since a few days and it is not related to the token storage in my case. I also don't have any custom binary_sensor. I'm on plugin version 0.3.14. The debug logs don't show any errors. It seems to be able to connect to the miniserver and also seems to detect the devices properly but then fails with this message and loxone is not set up. Any ideas on what to check?

The loxone platform for the binary_sensor integration does not support platform setup. Please remove it from your config.

JoDehli commented 2 years ago

The message with the binary sensor is not causing any major issues. I do not exactly know why this message appears but it is only a waring.

Try to get more details with other logging parameters.

tanker11 commented 2 years ago

Hello,

I had exactly the same issues. Creating the .homeassistant folder helped but the change related to binary sensor caused that the previously created sensor.xxxx entities were changed to binary_sensor.xxxx which caused a lot of things to fix in automations/node-red. So I would consider a warning that this is a breaking change.