asantaga / wiserHomeAssistantPlatform

Platform and related climate/sensors to support the Drayton Wiser Home Heating System
MIT License
235 stars 44 forks source link

Impossible to connect with secret code - EU (France) Version of the Hub #261

Closed djeev1 closed 2 years ago

djeev1 commented 2 years ago

Hi all

I'm very new to Home Assitant and I'm not a geek of programming. I'm just a geek of domotic items.

In my house I have a hub to use with all my Wiser switches / shutters. By following your tutorial I was able to install wiser heat App as an integration using HACS. But when I hit the configure button (in green) it's asking me to enter the key that I have saved in a text file prior to the installation. Once I enter it, I get and error message.

Can someone here help me please. Thanks you in advance.

Here below is the Log file:

2022-06-16 23:10:39 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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-06-16 23:10:39 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration wiser 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-06-16 23:20:08 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub Traceback (most recent call last): File "/config/custom_components/wiser/config_flow.py", line 152, in async_step_zeroconf_confirm validated = await validate_input(self.hass, user_input) File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input wiser_id = wiser.system.name AttributeError: 'NoneType' object has no attribute 'name' 2022-06-16 23:20:37 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub Traceback (most recent call last): File "/config/custom_components/wiser/config_flow.py", line 152, in async_step_zeroconf_confirm validated = await validate_input(self.hass, user_input) File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input wiser_id = wiser.system.name AttributeError: 'NoneType' object has no attribute 'name' 2022-06-16 23:22:16 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub Traceback (most recent call last): File "/config/custom_components/wiser/config_flow.py", line 152, in async_step_zeroconf_confirm validated = await validate_input(self.hass, user_input) File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input wiser_id = wiser.system.name AttributeError: 'NoneType' object has no attribute 'name'

msp1974 commented 2 years ago

Can you provide details of the model of hub you have and from what country. This integration does work with some european hubs but not all. A link to it on rhe website would be handy.

djeev1 commented 2 years ago

Thank you for your answer. As I have mentionned in my previous message the conuntry is: France.

The Wiser hub is this one: https://www.maisonmoderne-electricite.fr/wiser-odace-wiser-unica/15242-passerelle-wifi-pour-tous-les-appareils-du-systeme-wiser-zigbee-schneider-3606481451385.html?gclid=CjwKCAjwqauVBhBGEiwAXOepkVG94yGlZQ2FzpHOgsKl-iSHV5ptpStfA1VkhFm6FwkeNgrvffhTuxoCzAAQAvD_BwE

I really hope we'll be able to integrate this hub to HA, this is the main reason for me to use HA.

Many thanks and feel free to ask more details.

djeev1 commented 2 years ago

Hi all some news about my Wiser integration I've managed to connect to my hub by using the "Home Assistant" App on my phone. I think my issue came because my PC is linked with an ethernet cable and the Wiser hub is in wifi. So as my phone is connected to the same wifi access point, I've managed to connect to wiser hub.

This been done we could say ok fine so thinks will work. Here comes the negative point. Nothing is working correctly. The equipments connected to my wiser are: S520522W: Dimmable switches S520567W: Shutters operating switches.

For the Dimmable switch I have 2 problemes: 1/ It is shown as a simple "On and Off" switch, not a cursor 2/ I'm able to operate the unique switch, but when I turn it "ON", the light stays blinking (ON/OFF/ON/OFF...)

For the Shutters I have 2 problemes: 1/ It is shown as a simple "On and Off" switch, not a cursor like we can imagine for a shutter closing with a percentage. 2/ I Get the following mesage when press the unique button: "Failed to call service switch/turn_on. Restendpoint notfound on Wiser Hub 192.168.......

If someone can help me please.

Many thanks

msp1974 commented 2 years ago

I have a feeling that the currently released version may have lot of issues with lights and shutters. @LGO44 and i have been doing a lot of work to support this that should be released over this weekend. I would wait for this release and then try it after that. I think he has the same hub as you.

djeev1 commented 2 years ago

Ok sounds great so I will wait for this release. Many thanks for your support and work. Please give me the link overhere when it is ready and in future if I can help (for testing etc...) please be free to ask. I have like 40 schneider equipments (S520522W, S520530W and S520567W).

djeev1 commented 2 years ago

As my first goal to use HA is the integration of schneider equipments (as their application is very poor) and by the same way to combine with other smart equipments, I'm ready to help you as much as I can.

I was thinking about a way, may be it's stupid but as we know the Wiser Home / Heat application can talk to google or Alexa with a lot of commands available (for exemple the shutters switches work well with Alexa, in google they work but no possibility to have their status only vocal commands). So can't we find a way in HA to emulate something like the google or Alexa and then Wiser Home will think that it's taking with Google / Alexa so we get the same commands / devices listed in HA ?

LGO44 commented 2 years ago

Thank you for your answer. As I have mentionned in my previous message the conuntry is: France.

The Wiser hub is this one: https://www.maisonmoderne-electricite.fr/wiser-odace-wiser-unica/15242-passerelle-wifi-pour-tous-les-appareils-du-systeme-wiser-zigbee-schneider-3606481451385.html?gclid=CjwKCAjwqauVBhBGEiwAXOepkVG94yGlZQ2FzpHOgsKl-iSHV5ptpStfA1VkhFm6FwkeNgrvffhTuxoCzAAQAvD_BwE

I really hope we'll be able to integrate this hub to HA, this is the main reason for me to use HA.

Many thanks and feel free to ask more details.

@djeev1 I have the same wiser box and as @msp1974 says, I use it in HA

LGO44 commented 2 years ago

Ok sounds great so I will wait for this release. Many thanks for your support and work. Please give me the link overhere when it is ready and in future if I can help (for testing etc...) please be free to ask. I have like 40 schneider equipments (S520522W, S520530W and S520567W).

good idea to use Schneider, those part numbers are Odace devices , I use Unica but no doubt it will work. I use them since last december.

djeev1 commented 2 years ago

Thank you for your answer Again same as yesterday I get the same connection issue to the hub. It says to go and check the Logs but I can't find anything related to the connection issue ?

msp1974 commented 2 years ago

As my first goal to use HA is the integration of schneider equipments (as their application is very poor) and by the same way to combine with other smart equipments, I'm ready to help you as much as I can.

I was thinking about a way, may be it's stupid but as we know the Wiser Home / Heat application can talk to google or Alexa with a lot of commands available (for exemple the shutters switches work well with Alexa, in google they work but no possibility to have their status only vocal commands). So can't we find a way in HA to emulate something like the google or Alexa and then Wiser Home will think that it's taking with Google / Alexa so we get the same commands / devices listed in HA ?

If you subscribe to nabu casa (HA cloud) you can integrate anything in HA with alexa/google. However, choose wisely as we have had reports that google does not support auto mode for heating and therefore doesnt work very well with this integration.

I have mine integrated to alexa and it is pretty good to set heating temp or get room tsmp by voice etc. Also turn on/off and dim lights (although i do not use wiser lights due to non availability in UK).

LGO44 commented 2 years ago

Hi all some news about my Wiser integration I've managed to connect to my hub by using the "Home Assistant" App on my phone. I think my issue came because my PC is linked with an ethernet cable and the Wiser hub is in wifi. So as my phone is connected to the same wifi access point, I've managed to connect to wiser hub.

This been done we could say ok fine so thinks will work. Here comes the negative point. Nothing is working correctly. The equipments connected to my wiser are: S520522W: Dimmable switches S520567W: Shutters operating switches.

For the Dimmable switch I have 2 problemes: 1/ It is shown as a simple "On and Off" switch, not a cursor 2/ I'm able to operate the unique switch, but when I turn it "ON", the light stays blinking (ON/OFF/ON/OFF...)

For the Shutters I have 2 problemes: 1/ It is shown as a simple "On and Off" switch, not a cursor like we can imagine for a shutter closing with a percentage. 2/ I Get the following mesage when press the unique button: "Failed to call service switch/turn_on. Restendpoint notfound on Wiser Hub 192.168.......

If someone can help me please.

Many thanks

I have quite the same topology: my pc is connected to a router ( local network) by an Ethernet cable my wiser box is connected by wifi...

https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965/588?u=lgo44

Connexion avec Box Wiser .pdf

djeev1 commented 2 years ago

Thank you for all these documentations and links. This is the exact procedure that I did.

Since this afternoon my Add-on WiserHeat has crashed and now again same as Yesterday I'm unable to get connected to the Hub. This is the Log message:

ull logs
2022-06-17 16:34:12 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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-06-17 16:34:12 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration wiser 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-06-17 16:36:50 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub
Traceback (most recent call last):
File "/config/custom_components/wiser/config_flow.py", line 152, in async_step_zeroconf_confirm
validated = await validate_input(self.hass, user_input)
File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input

wiser_id = wiser.system.name
AttributeError: 'NoneType' object has no attribute 'name'

Ysterday I was able to connect with my iphone and Home assistant app on it, but now it doesn't allow me at all.

Thanks

msp1974 commented 2 years ago

Ok i think the connection issues you are having are not related to the version of the integration, so we need to get that sorted.

Strange that it has worked and now not. Unlikely related to using your phone as the HA server is talking to the hub not the client you are accessing HA with. This unknown error is likely caused by the hub api not being what is expected which would be a consistant issue not a sporadic one.

Can you tell me the firmware version on your hub? Available in the wiser app in devices and hub option. Is it connected to the Wiser cloud?

djeev1 commented 2 years ago

Hi msp1974 and thanks for the reply, here below the answers for your questions:

1/ Yes the hub is connected to the cloud (which means it keeps updating automaticaly) 2/ My firmware is: 3.10.5

As you said it is very strange. If the integration in HA will work fine with at least the shutters and dimmable switches, my goal is to remove it from schneider cloud to avaid getting automatic updates.

Some additional info: Right now all the Wiser push buttons (S520530W) are already taken away from Wiser app and connected directly to Tuya. The shutters switches (S520567W) seems to be locked with Wiser, else I would have taken them away as well. The dimmable switches (S520522W) can be connected to Tuya as well but the dimmable function is not acurate with Tuya and it doesn't keep in memory the latest settings of the variator), bezcause this is stored in the Wiser hub.

djeev1 commented 2 years ago

What is strange as you mentionned above is, that HA discover my Wiser Hub properly as (WiserHeat03FC1C), but when I hit the configure button and when I get the popup to enter they only the problems of connection start with the error messages. I'm available this weekend so if you have questions please ask me. If I can help you in your work as least by testing.

msp1974 commented 2 years ago

OK let me get the new version released tomorrow or Sunday and I will add some better debugging to see why this is not working and we will go from there.

djeev1 commented 2 years ago

Great idea and thanks

msp1974 commented 2 years ago

Released v3.0.24 earlier. I would remove and readd the integration and let me know how you get on. If it still fails can you turn on debug logging for this integration in your configuration.yaml file.

Should look like this:

  default: warning
  logs:
    custom_components.wiser: debug

And send me the error message as before

djeev1 commented 2 years ago

Ok thanks let me try and I'll get back to you.

djeev1 commented 2 years ago

Ok So I still get the same issue with getting connected to the hub. I have pasted your code in configuration?yaml but I don't think it worked ? May be I did it wrong. Please check and tell me:

2022-06-19 10:13:35 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs 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-06-19 10:13:35 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration wiser 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-06-19 10:15:32 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub
Traceback (most recent call last):
File "/config/custom_components/wiser/config_flow.py", line 153, in async_step_zeroconf_confirm
validated = await validate_input(self.hass, user_input)
File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input
wiser_id = wiser.system.name
AttributeError: 'NoneType' object has no attribute 'name'

I Just took the code you gave above and pasted it, may be this is not the right way ?

djeev1 commented 2 years ago

My configuration.yaml is looking like this now `

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

# Text to speech
tts:
  - platform: google_translate

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

  default: warning
  logs:
    custom_components.wiser: debug`
msp1974 commented 2 years ago

Sorry, my fault was doing on my tablet and it missed some off. Should be

logger:
  default: warning
  logs:
    custom_components.wiser: debug
djeev1 commented 2 years ago

This is my new log after doing the latest modifications.

2022-06-19 13:02:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs 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-06-19 13:02:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration wiser 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-06-19 13:04:05 ERROR (MainThread) [custom_components.wiser.config_flow] Unknown error connecting to Wiser Hub
Traceback (most recent call last):
File "/config/custom_components/wiser/config_flow.py", line 153, in async_step_zeroconf_confirm
validated = await validate_input(self.hass, user_input)
File "/config/custom_components/wiser/config_flow.py", line 56, in validate_input
wiser_id = wiser.system.name
AttributeError: 'NoneType' object has no attribute 'name'
2022-06-19 13:04:05 DEBUG (MainThread) [custom_components.wiser.config_flow] 'NoneType' object has no attribute 'name'

This is my configuration.yaml


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

# Text to speech
tts:
  - platform: google_translate

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

logger:
  default: warning
  logs:
    custom_components.wiser: debug
msp1974 commented 2 years ago

Hmmm. That doesn't seem to make any difference. I think the API is not loading correctly and I will need you to do some testing for me as below to see what is going on.

1) Can you install the SSH & Web Terminal addon - https://community.home-assistant.io/t/home-assistant-community-add-on-ssh-web-terminal/33820 2) Once installed, run this: image

3) Then on the command line run (make sure it finished successfully): pip install wiserHeatAPIv2 image

4) The on the same command line, run (replacing the words in brackets with your hub IP address and secret key): wiser output [hubIP] [hubKey] all image

5) As it has said, this should have created 3 files. Now I need a copy of those 3 files (all sensitive data has been anonymised). Best way is to copy them into your config folder so you can access via linux host in you HA config folder in wiser_data cp -R /root/wiser_data /config/wiser_data

Hope this is ok for you to follow (sorry know you're not a programmer but not sure of your linux comfort so maybe teaching to suck eggs).

djeev1 commented 2 years ago

I've managed to install the terminal but from there I'm stucked. When I use the command line "pip..." I get a warning "Running pip as the 'root' user can result in broken permissions ans conflicting behaviour with the system package manager....

But anyway I've managed to get these 3 files

Thanks

image

djeev1 commented 2 years ago

Here are the 3 files.

I hope, I've done it in the correct way. Let me know and again thanks a lot for this great support.

msp1974 commented 2 years ago

Aaaahhhh, you have no schedules setup. The api won't create without any schedules. This may not be a good idea and I will look into changing that but for now, if you create a schedule in the Wiser app (you do not need to assign it to a device), I think this will fix your problem. Let me know.

djeev1 commented 2 years ago

Yes you are right. I've just created a small schedule and I was able to connect to the APP. Now I will try to check the shutters and dimmable lights and I'll let you know very soon. Again Many thanks for this great support and work you are doing.

djeev1 commented 2 years ago

OK

Here are the results of my first tests:

For the shutters (S520567W): It's seems to work when you press up or down, but if you press "STOP / Pause" let's say when you were going down, then it will go back up a little bit before stopping / pausing.

For the dimmable lights (S520522W): We now have the control as a simple button (and a cursor when you click into it). The button is working but the reported status is not correct (or very very slow). For example, if I power on the switch, it will turn on the lights, but the status in the app (in HA) is still showing as switched off (because it's returning back to "off" position). This doesn't effect the real light which remains turn "on". After 10 seconds the real status is shown again in HA. This is the same when we power off. Let's say that we have a delay of 10 to 15 sec before getting the correct status.

I Hope my explainations are clear for you, else I can make a short video.

Let me know. I Keep trying anyway.

LGO44 commented 2 years ago

OK

Here are the results of my first tests:

For the shutters (S520567W): It's seems to work when you press up or down, but if you press "STOP / Pause" let's say when you were going down, then it will go back up a little bit before stopping / pausing.

For the dimmable lights (S520522W): We now have the control as a simple button (and a cursor when you click into it). The button is working but the reported status is not correct (or very very slow). For example, if I power on the switch, it will turn on the lights, but the status in the app (in HA) is still showing as switched off (because it's returning back to "off" position). This doesn't effect the real light which remains turn "on". After 10 seconds the real status is shown again in HA. This is the same when we power off. Let's say that we have a delay of 10 to 15 sec before getting the correct status.

I Ho pe my explainations are clear for you, else I can make a short video.

Let me know. I Keep trying anyway.

For the shutters, this is due to the refresh interval of the position. when you stop from HA in manual it save the current position, and put it in the target position that why you have the back movement.. If you ask for a position then the shutter move to this position...

Here are pieces of lovelace to request manually different positions: In a dashboard you add an entity card, in the code editor select all and paste my file (with you settings) and save. Shutter datas.txt shutter commands.txt my shutter cover.wiser_shutter_salle_salon_devant_control replace _salle_salon_devant by your own device name

Here are the equivalents for lights

light.txt my device :light.wiser_dimmablelight_salle_lustre3_light replace salle-lustre3 by your own device name

LGO44 commented 2 years ago

what would we do without Mark's help, his patience? @msp1974 another time THANKS Christian

msp1974 commented 2 years ago

This doesn't effect the real light which remains turn "on". After 10 seconds the real status is shown again in HA. This is the same when we power off. Let's say that we have a delay of 10 to 15 sec before getting the correct status.

I saw this when we first added a smartplug to the integration. When we send a command to the hub, we immediately read its status to update HA. However, with Smartplugs (and maybe the same for lights) the hub can take a second or so to update the status so we read the old status and do not reads the new one until the next scheduled update (every 30 secs).

I think we added a small delay to reading the status after an update for the smart plugs. I think we should maybe do the same for lights too. I will open a seperate issue for that to remind me.

djeev1 commented 2 years ago

Ok thanks Mark for this great work, I think by adding a delay this can wait until the next status reading (30 sec). As @LGO44 said thanks to your work we finnaly have a system where wiser and HA can communicate. I really hope schneider will not find this and try to block it in a future update. I think we must very few people in the world to combine Wiser and HA so may be schneider won't see this.

Thanks also to @LGO44, I will try your codes today and see if this is going to make a difference.

msp1974 commented 2 years ago

Good news is they are aware of it and internally want to support. They have been in communication with Angelo but not got any freebies yet for testing! :-)

djeev1 commented 2 years ago

Yeah I was also in contact with them few months ago, they talked to me about alternative solutions to their system (which is very limited). This was the first step for me to pair some of their equipment's with "Smart Life" and now with HA. :)

LGO44 commented 2 years ago

As you can guess I am a former Schneider, I share with the Wiser Marketing about your integration...

msp1974 commented 2 years ago

@djeev1 , going to close this issue but please reach out if you need anymore assistance.

djeev1 commented 2 years ago

ok thanks this issue is Solved now.