claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
63 stars 13 forks source link

TH1123WF are showing wrong "current temperature" after a few days #185

Closed stephanerobertson closed 6 months ago

stephanerobertson commented 8 months ago

Hello,

I have 5 TH1123WF thermostat that are working correctly but after a few days, the "current temparature" is wrong. The thermostat card show incorrect temperature and even in the developper tools the temperature is wrong. Everything else is still working while the temperature is wrong. I'm able to fix the problem with a reboot but after a few days the problem reappear.

Any idea?

image

claudegel commented 8 months ago

Can you check with another thermostat card ? also can you look in dev-tool/state for those thermostats to see what is the value for current temparature value. also add logging in configuration.yaml

logger:
  default: warning
  logs:
    homeassistant.custom_components: debug
    custom_components.neviweb130: debug

Then restart HA and look in home-assistant.log to find line like this: [custom_components.neviweb130.climate] Updating neviweb130 climate name of your thermostat... to see if the value received from Neviweb are good for roomTemperature. Value should be stated like this roomTemperature': {'value': 21.61}

stephanerobertson commented 8 months ago

Helloe Claude, here are the answers:

Can you check with another thermostat card ?

Not all the card have the problem at the same time. Have seen the problem on 2 different card so far. This morning i have the problem with another card.

also can you look in dev-tool/state for those thermostats to see what is the value for current temparature value.

In the Dev-tool the current temperature is the same. It shows 18.6 but it should say 22

image

also add logging in configuration.yaml

logger:
  default: warning
  logs:
    homeassistant.custom_components: debug
    custom_components.neviweb130: debug

I have enable debug, i need to restart so it will work some time.

Then restart HA and look in home-assistant.log to find line like this: [custom_components.neviweb130.climate] Updating neviweb130 climate name of your thermostat... to see if the value received from Neviweb are good for roomTemperature. Value should be stated like this roomTemperature': {'value': 21.61}

still waiting for the problem to reappear but i found those logs in the home-assisant.log file. I can see that the problem started at 1:43 this morning with the following error:

2023-11-03 01:43:53.381 WARNING (SyncWorker_2) [custom_components.neviweb130.climate] Device neviweb130 climate Salle de jeux is disconected from Neviweb: {'error': {'code': 'DVCUNVLB', 'data': {'identifier': '409151fffe9cca30'}}}...(SKU: TH1123WF) 2023-11-03 01:43:53.382 WARNING (SyncWorker_2) [custom_components.neviweb130.climate] This device neviweb130 climate Salle de jeux is de-activated and won't be polled until you put it back on HA and Neviweb. 2023-11-03 01:43:53.382 WARNING (SyncWorker_2) [custom_components.neviweb130.climate] Then you will have to re-activate device neviweb130 climate Salle de jeux with service.neviweb130_set_activation, or just restart HA.

I hope this help. Will get back to you once i have the debugs

claudegel commented 8 months ago

The problem is there:

This device neviweb130 climate Salle de jeux is de-activated and won't be polled until you put it back on HA and Neviweb.
 {'error': {'code': 'DVCUNVLB', 'data': {'identifier': '409151fffe9cca30'}}}...(SKU: TH1123WF)

with the wifi devices, if your router can't support many wifi connection at the same time then some wifi device are dropped from the router wifi and disconected from Neviweb. When I catch the message 'code': 'DVCUNVLB, I stop polling Neviweb for that device until next HA restart or until you switch the attribute Activation: false to Activation: true. There is a service for that, neviweb130.set_activation to put it back to True and restart polling. Some router are known to drop wifi devices when the wifi network is loaded. Some router can't support more then 30 connection at the same time. The best solution is to add another wifi network specific to your device. I'm using a TP-Link EAP245 and all my wifi device for domotic are connected to this one. My cellphone, tablet etc are connected to another wifi network.

stephanerobertson commented 8 months ago

The problem is there:

This device neviweb130 climate Salle de jeux is de-activated and won't be polled until you put it back on HA and Neviweb.
 {'error': {'code': 'DVCUNVLB', 'data': {'identifier': '409151fffe9cca30'}}}...(SKU: TH1123WF)

with the wifi devices, if your router can't support many wifi connection at the same time then some wifi device are dropped from the router wifi and disconected from Neviweb. When I catch the message 'code': 'DVCUNVLB, I stop polling Neviweb for that device until next HA restart or until you switch the attribute Activation: false to Activation: true. There is a service for that, neviweb130.set_activation to put it back to True and restart polling. Some router are known to drop wifi devices when the wifi network is loaded. Some router can't support more then 30 connection at the same time. The best solution is to add another wifi network specific to your device. I'm using a TP-Link EAP245 and all my wifi device for domotic are connected to this one. My cellphone, tablet etc are connected to another wifi network.

Hello Claude, thanks for the quick answers.

Where can i turn that switch to TRUE?

I'm using an enterprise grade access point (Aruba), they can handle around 255 clients and i do have around 27 clients. I will try to find out if they disconnect from the network. I'm using this simple tool (PingPlotter) to ping them continuously. Disconnection can happen for different reasons, does Sinope is doing maintenance or any other stuff during the night?

Here's a screenshot of that tool: image

stephanerobertson commented 8 months ago

ok i got the problem again exactly at 12:54:04.

I was pinging my 4 thermostats and i was also pinging google 8.8.8.8. See picture below.. I can tell you that it's not a problem on my network because none of my thermostats stop responding. So at this point it look like there is a problem on the neviweb side..

What is the timeout/retry value on the request you are doing on there site? Is there a way to increase the timeout value or the number of retry?

If that is not possible i can create a service call for each thermostats to run every hour but that is a patch and not the best way to go.

image

claudegel commented 8 months ago

Maybe they are responding to a ping on your network but they stop responding to Neviweb so when HA is polling Neviweb to get thermostat data It get the answer {'error': {'code': 'DVCUNVLB' from Neviweb. HA is polling every scan_interval that you set in configuration.yaml. On my side it is 360, 6 minutes. You should not go below 3 minutes or Neviweb will disconect you from polling.

to reactivate those device just create an automation like this:

- id: reconnect_device
  initial_state: True
  condition:
    some condition that evaluate for example if device state Activation = false for 15 minutes
  action:
    - service: neviweb130.set_activation
      data:
        entity_id: climate.neviweb130_climate_salle_de_jeu
        active: true

I've sent this issue to Sinopé about wifi thermostat to see if they can come with something we can do to improve stability. That problem only occur with wifi devices. Maybe we need to increase delay between Neviweb device polling.

stephanerobertson commented 8 months ago

Maybe they are responding to a ping on your network but they stop responding to Neviweb so when HA is polling Neviweb to get thermostat data It get the answer {'error': {'code': 'DVCUNVLB' from Neviweb. HA is polling every scan_interval that you set in configuration.yaml. On my side it is 360, 6 minutes. You should not go below 3 minutes or Neviweb will disconect you from polling.

to reactivate those device just create an automation like this:

- id: reconnect_device
  initial_state: True
  condition:
    some condition that evaluate for example if device state Activation = false for 15 minutes
  action:
    - service: neviweb130.set_activation
      data:
        entity_id: climate.neviweb130_climate_salle_de_jeu
        active: true

I've sent this issue to Sinopé about wifi thermostat to see if they can come with something we can do to improve stability. That problem only occur with wifi devices. Maybe we need to increase delay between Neviweb device polling.

Sounds good, let me know if you have any development on this. I've created an automation for now. Thanks for your support!

claudegel commented 8 months ago

Ok I've added a persistent notification service that will show up in the notification pannel on your web UI when a devives get disconnected from Neviweb. This way you won't need to check your log. See https://github.com/claudegel/sinope-130/tree/better-log/custom_components/neviweb130 You just need to replace file climate.py to test it

stephanerobertson commented 8 months ago

Perfect thanks, i will try it tomorrow.

Le dim. 5 nov. 2023, 11 h 49, Claude Gelinas @.***> a écrit :

Ok I've added a persistent notification service that will show up in the notification pannel on your web UI when a devives get disconnected from Neviweb. This way you won't need to check your log. See

https://github.com/claudegel/sinope-130/tree/better-log/custom_components/neviweb130 You just need to replace file climate.py to test it

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1793788561, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T4GFHRL3YMLKGVAMRDYC6YRJAVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG44DQNJWGE . You are receiving this because you authored the thread.Message ID: @.***>

claudegel commented 8 months ago

Sinopé send me some info for the wifi thermostats. Router model Bell hub 3000, Telus boost6 and Virgin are known to drop devices. On your router if available you can change parameter DTIM interval to 1

stephanerobertson commented 8 months ago

I'm using an Aruba access point with DTIM = 1 already. If you look at the screenshot i put in thread (pingplotter image), we can see that the problem is not on the WiFi because the thermostats are not disconnecting (not losing any ping) when the problem happen. We can also see that i'm not losing any ping to google 8.8.8.8 so my connection to internet is good. I can't ping neviweb.com because Sinope is blocking it.

I think the problem is caused by a delay somewhere. That is why i was asking what was your timeouts/retry before you declare it down. May be neviweb have some intermittent congestion/delay.

Le lun. 6 nov. 2023, à 09 h 10, Claude Gelinas @.***> a écrit :

Sinopé send me some info for the wifi thermostats. Router model Bell hub 3000, Telus boost6 and Virgin are known to drop devices. On your router if available you can change parameter DTIM interval to 1

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1794907869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3TY7DMETIELXFJCKPTTYDDVUXAVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJUHEYDOOBWHE . You are receiving this because you authored the thread.Message ID: @.***>

--

Stéphane Robertson

gobol007 commented 8 months ago

Mes TH1124ZB-G2 et mon TH1124ZB semble aussi ne pas afficher le bon "current temperature"... je sais pas si c'Est depuis la mise à jour d'hier (la mise à jour des notifications)

gobol007 commented 8 months ago

Mes TH1124ZB-G2 et mon TH1124ZB semble aussi ne pas afficher le bon "current temperature"... je sais pas si c'Est depuis la mise à jour d'hier (la mise à jour des notifications)

image

gobol007 commented 8 months ago

Si ça peut aider... maintenant aucun se met à jour... pas juste le "current temperature" :S image

stephanerobertson commented 8 months ago

Bonjour Claude a publié une mise à jour qui te permettras de voir une notification dans HA. De mon côté j'ai créé une routine pour redémarré la connexion en attendant d'avoir une résolution.

condition: or conditions:

gobol007 commented 8 months ago

Bonjour Claude a publié une mise à jour qui te permettras de voir une notification dans HA. De mon côté j'ai créé une routine pour redémarré la connexion en attendant d'avoir une résolution.

condition: or conditions:

  • condition: state entity_id: climate.neviweb130_climate_salle_de_jeux attribute: Activation state: false
  • condition: state entity_id: climate.neviweb130_climate_cuisine attribute: Activation state: false
  • condition: state entity_id: climate.neviweb130_climate_salon_sous_sol attribute: Activation state: false
  • condition: state entity_id: climate.neviweb130_climate_bureau attribute: Activation state: false

Tu redémarre la connection de quelle façon ? (tu as le code de l'automation au complet ?) (Oui j'ai mit la mise à jour) ha... ok je vois le service set_activation

claudegel commented 8 months ago

I just publish a release 2.4.4 that remove self._activ and just send a notification to dashboard when device get disconected from Neviweb. J'ai enlevé la ligne self._activ et les appareils ne seront plus désactivées mais une notification apparaitra sur le dashboard pour aviser du problème de communication.

claudegel commented 8 months ago

Hi look like release 2.4.4 can produce many notification on dashboard so I switch to another method. When the error ["error"]["code"] == "DVCUNVLB" is received on device update this device will be deactivated for 20 minutes and a notification will be sent to dashboard. After that period another notification will be sent to dashboard to tell that device update is restarted. This way you'll be aware that there is a problem with one of your device on your network. This is mostly for wifi devices, but from time to time when Sinopé update Neviweb code it is possible that we get that same error message. You can test this change by downloading branch: https://github.com/claudegel/sinope-130/tree/claudegel-patch-1/custom_components/neviweb130 you can pick only climate.py or download everything. Let me know if it's good like this so I can release this

stephanerobertson commented 8 months ago

Hi Claude,

What is the best way to update a single file like this one (climate.py)?

Le mer. 8 nov. 2023, à 22 h 29, Claude Gelinas @.***> a écrit :

Hi look like release 2.4.4 can produce many notification on dashboard so I switch to another method. When the error ["error"]["code"] == "DVCUNVLB" is received on device update this device will be deactivated for 20 minutes and a notification will be sent to dashboard. After that period another notification will be sent to dashboard to tell that device update is restarted. This way you'll be aware that there is a problem with one of your device on your network. This is mostly for wifi devices. but from time to time when Sinopé update Neviweb code it is possible that we get that same error message. You can test this change by downloading branch

https://github.com/claudegel/sinope-130/tree/claudegel-patch-1/custom_components/neviweb130 you can pick only climate.py or download everything. Let me know if it's good like this so I can release this

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1803107474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T7DAHDUHP7R6OFDYFLYDRE2TAVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGEYDONBXGQ . You are receiving this because you authored the thread.Message ID: @.***>

--

Stéphane Robertson

claudegel commented 8 months ago

To update a single file there is two ways: 1- go to the branch specified above. Click on the file climate.py. This will open the file. above the first line click the second icon on the wright (copy raw file) go to your HA using the file editor, navigate to dir config/custom_components/neviweb130. open climate.py and select everything paste the copy you did on github save file and restart HA 2- Do the same and open climate.py above the first line on the wright click on the third icon (download raw file) delete your climate.py and replace by the new one. restart HA

File editor can be added to HA via parameters/complementary module. Click on the blue button at the wright down corner and search for file editor. This will add a file editor button in the left column in HA. With that you can edit any configuration file.

stephanerobertson commented 8 months ago

Hello Claude,

That seems to be better, i understand that a notification is shown only when the error message is seen and when it is reactivated (after 20 minutes). Between that time, current temperature will not be updated.

It would interesting to find why the process is giving this error though. I have difficulty to point the problem on the thermostats because you are pooling neviweb not the thermostats. With the neviweb app, i do not have any issue and current temperature is always showing the right value. If there are traces/debugs i can capture let me know.

Thanks for your help.

Le mer. 8 nov. 2023, 22 h 29, Claude Gelinas @.***> a écrit :

Hi look like release 2.4.4 can produce many notification on dashboard so I switch to another method. When the error ["error"]["code"] == "DVCUNVLB" is received on device update this device will be deactivated for 20 minutes and a notification will be sent to dashboard. After that period another notification will be sent to dashboard to tell that device update is restarted. This way you'll be aware that there is a problem with one of your device on your network. This is mostly for wifi devices. but from time to time when Sinopé update Neviweb code it is possible that we get that same error message. You can test this change by downloading branch

https://github.com/claudegel/sinope-130/tree/claudegel-patch-1/custom_components/neviweb130 you can pick only climate.py or download everything. Let me know if it's good like this so I can release this

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1803107474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T7DAHDUHP7R6OFDYFLYDRE2TAVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGEYDONBXGQ . You are receiving this because you authored the thread.Message ID: @.***>

claudegel commented 8 months ago

Hi I've push that release just now. I'm still working to identify why some devices are disconnecting from Neviweb. Sinopé told me that this is mostly with wifi devices and with few poor routers that drop device from the network. The device deactivation is only activated when Neviweb reply to HA update with error message DVCUNVLB which is when Neviweb can't poll the device to get the new data. Sometime it is when Sinopé is doing an update on Neviweb server but that don't take much time and it is normally at night or during weekend. In Neviweb if the device do not respond, the data is not updated but it take more time before Neviweb put a note about unavailable device. When HA poll Neviweb for device data, Neviweb poll the device and if it is not responding we get the error message. I think it's better to know rapidly that something is wrong about one device especially in the peak season. Let me know if you have a better idea. Every suggestion are welcome.

stephanerobertson commented 8 months ago

Hi Claude,

I did a simple test by blocking access to the internet on one of my thermostat. It seems to take around 5 minutes for Neviweb to declare it down and not show the current temperature in the neviweb app. I'm surprised to hear that Neviweb polled the thermostats..If that is true then neviweb needs to keep a session open with all the thermostats in the world to be able to poll the devices behind a firewall. I thought that it was the opposite, I mean the thermostat updating and refreshing neviweb periodically.

I can let you know if i have an idea, i'm a network/wireless expert and my programming skills are less than yours for sure.

Networking applications usually have timeouts and retry values because we can have network delays/congestions.

For example networking application do something like this:

connection to server attempt #1 wait for a timeout value (ex.: 10sec) connection to server attempt #2 wait for a timeout value (ex.: 10sec) connection to server attempt #3 wait for a timeout value (ex.: 10sec) If it fails after the configured number of retries then the server is declared down and we move the backup/secondary server Also, applications usually wait for an amount of time before trying again the primary server.

In your case, something similar could be done if not already in place. I think that HA/your integration should have a mechanism to try to recover before displaying a notification. I think that you are now waiting 20min before restarting the process and sending a notification. Maybe a second attempt and a third attempt with a delay between each attempt can be done before declaring neviweb down and sending a notification. In the long term, I think people will find the notifications disturbing if they get too many notifications (specifically for those with unstable connection)

Not sure if that makes sense, probably it will if you can't find and fix why you have this error.

Le jeu. 9 nov. 2023, à 23 h 10, Claude Gelinas @.***> a écrit :

Hi I've push that release just now. I'm still working to identify why some devices are disconnecting from Neviweb. Sinopé told me that this is mostly with wifi devices and with few poor routers that drop device from the network. The device deactivation is only activated when Neviweb reply to HA update with error message DVCUNVLB which is when Neviweb can't poll the device to get the new data. Sometime it is when Sinopé is doing an update on Neviweb server but that don't take much time and it is normally at night or during weekend. In Neviweb if the device do not respond, the data is not updated but it take more time before Neviweb put a note about unavailable device. When HA poll Neviweb for device data, Neviweb poll the device and if it is not responding we get the error message. I think it's better to know rapidly that something is wrong about one device especially in the peak season. Let me know if you have a better idea. Every suggestion are welcome.

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1805056915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T32TJJPCWCXSMJE663YDWSJ5AVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBVGA2TMOJRGU . You are receiving this because you authored the thread.Message ID: @.***>

--

Stéphane Robertson

claudegel commented 8 months ago

In fact the zigbee and probably the wifi devices are doing what we call reporting. So neviweb don't need to poll directly the devices. For the cluster/attribute that can send report there is a minimun period and a maximum period for which they need to send the value of the attribute. For exeample for light any change on or off must be reported immediately but if there is no change the value will be reported avery 10 minutes. This way Neviweb know that the device is connected. For thermostat it must report current temperature at least every 5 minutes.

Neviweb130 is polling Neviweb at every scan_intervall set in the parameter because we cannot receive the devices report.

If Neviweb do not receive report for a device it set it disconected.

Neviweb is sending time once a day and exterior temperature every few minutes for the thermostats. The device must send a acknowledgement so Neviweb know that device is still connected and receive the update. If nothing is received then device is marked as disconnected.

If when we send a request to Neviweb we receive an error message saying device unavailable there is nothing we can do except wait for the device to reconnect to Neviweb. That's why I pause the device request for 20 minutes et post a notification so the user can check what's wrong with the device connection, especially the wifi devices that seems to disconnect more frequently.

After 20 minutes I restart the request hoping that the device will be there.

Now there is more disconnect also because Sinopé is updating neviweb code for the new Hydro project. During the update our request receive the same error message but this only last few minutes until Neviweb is reloaded.

Maybe we can put notification as a parameter for neviweb130. Something like Notify: True or False. By default it will be True but user will have choice to disconect notifycation.

Claude Gelinas

Le Fri, 10 Nov 2023 15:09:11 -0800 stephanerobertson @.***> a écrit:

Hi Claude,

I did a simple test by blocking access to the internet on one of my thermostat. It seems to take around 5 minutes for Neviweb to declare it down and not show the current temperature in the neviweb app. I'm surprised to hear that Neviweb polled the thermostats..If that is true then neviweb needs to keep a session open with all the thermostats in the world to be able to poll the devices behind a firewall. I thought that it was the opposite, I mean the thermostat updating and refreshing neviweb periodically.

I can let you know if i have an idea, i'm a network/wireless expert and my programming skills are less than yours for sure.

Networking applications usually have timeouts and retry values because we can have network delays/congestions.

For example networking application do something like this:

connection to server attempt #1 wait for a timeout value (ex.: 10sec) connection to server attempt #2 wait for a timeout value (ex.: 10sec) connection to server attempt #3 wait for a timeout value (ex.: 10sec) If it fails after the configured number of retries then the server is declared down and we move the backup/secondary server Also, applications usually wait for an amount of time before trying again the primary server.

In your case, something similar could be done if not already in place. I think that HA/your integration should have a mechanism to try to recover before displaying a notification. I think that you are now waiting 20min before restarting the process and sending a notification. Maybe a second attempt and a third attempt with a delay between each attempt can be done before declaring neviweb down and sending a notification. In the long term, I think people will find the notifications disturbing if they get too many notifications (specifically for those with unstable connection)

Not sure if that makes sense, probably it will if you can't find and fix why you have this error.

Le jeu. 9 nov. 2023, à 23 h 10, Claude Gelinas @.***> a écrit :

Hi I've push that release just now. I'm still working to identify why some devices are disconnecting from Neviweb. Sinopé told me that this is mostly with wifi devices and with few poor routers that drop device from the network. The device deactivation is only activated when Neviweb reply to HA update with error message DVCUNVLB which is when Neviweb can't poll the device to get the new data. Sometime it is when Sinopé is doing an update on Neviweb server but that don't take much time and it is normally at night or during weekend. In Neviweb if the device do not respond, the data is not updated but it take more time before Neviweb put a note about unavailable device. When HA poll Neviweb for device data, Neviweb poll the device and if it is not responding we get the error message. I think it's better to know rapidly that something is wrong about one device especially in the peak season. Let me know if you have a better idea. Every suggestion are welcome.

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1805056915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T32TJJPCWCXSMJE663YDWSJ5AVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBVGA2TMOJRGU . You are receiving this because you authored the thread.Message ID: @.***>

stephanerobertson commented 8 months ago

Hi Claude,

I have less notifications since 2 days but yes having the option to turn the notifications off (i guess by adding the option in the config file) would be good to have. Not sure how much time it is for you though. Thanks for your support and to have bring Sinopé to HA.

Le dim. 12 nov. 2023, 19 h 30, Claude Gelinas @.***> a écrit :

In fact the zigbee and probably the wifi devices are doing what we call reporting. So neviweb don't need to poll directly the devices. For the cluster/attribute that can send report there is a minimun period and a maximum period for which they need to send the value of the attribute. For exeample for light any change on or off must be reported immediately but if there is no change the value will be reported avery 10 minutes. This way Neviweb know that the device is connected. For thermostat it must report current temperature at least every 5 minutes.

Neviweb130 is polling Neviweb at every scan_intervall set in the parameter because we cannot receive the devices report.

If Neviweb do not receive report for a device it set it disconected.

Neviweb is sending time once a day and exterior temperature every few minutes for the thermostats. The device must send a acknowledgement so Neviweb know that device is still connected and receive the update. If nothing is received then device is marked as disconnected.

If when we send a request to Neviweb we receive an error message saying device unavailable there is nothing we can do except wait for the device to reconnect to Neviweb. That's why I pause the device request for 20 minutes et post a notification so the user can check what's wrong with the device connection, especially the wifi devices that seems to disconnect more frequently.

After 20 minutes I restart the request hoping that the device will be there.

Now there is more disconnect also because Sinopé is updating neviweb code for the new Hydro project. During the update our request receive the same error message but this only last few minutes until Neviweb is reloaded.

Maybe we can put notification as a parameter for neviweb130. Something like Notify: True or False. By default it will be True but user will have choice to disconect notifycation.

Claude Gelinas

Le Fri, 10 Nov 2023 15:09:11 -0800 stephanerobertson @.***> a écrit:

Hi Claude,

I did a simple test by blocking access to the internet on one of my thermostat. It seems to take around 5 minutes for Neviweb to declare it down and not show the current temperature in the neviweb app. I'm surprised to hear that Neviweb polled the thermostats..If that is true then neviweb needs to keep a session open with all the thermostats in the world to be able to poll the devices behind a firewall. I thought that it was the opposite, I mean the thermostat updating and refreshing neviweb periodically.

I can let you know if i have an idea, i'm a network/wireless expert and my programming skills are less than yours for sure.

Networking applications usually have timeouts and retry values because we can have network delays/congestions.

For example networking application do something like this:

connection to server attempt #1 wait for a timeout value (ex.: 10sec) connection to server attempt #2 wait for a timeout value (ex.: 10sec) connection to server attempt #3 wait for a timeout value (ex.: 10sec) If it fails after the configured number of retries then the server is declared down and we move the backup/secondary server Also, applications usually wait for an amount of time before trying again the primary server.

In your case, something similar could be done if not already in place. I think that HA/your integration should have a mechanism to try to recover before displaying a notification. I think that you are now waiting 20min before restarting the process and sending a notification. Maybe a second attempt and a third attempt with a delay between each attempt can be done before declaring neviweb down and sending a notification. In the long term, I think people will find the notifications disturbing if they get too many notifications (specifically for those with unstable connection)

Not sure if that makes sense, probably it will if you can't find and fix why you have this error.

Le jeu. 9 nov. 2023, à 23 h 10, Claude Gelinas @.***> a écrit :

Hi I've push that release just now. I'm still working to identify why some devices are disconnecting from Neviweb. Sinopé told me that this is mostly with wifi devices and with few poor routers that drop device from the network. The device deactivation is only activated when Neviweb reply to HA update with error message DVCUNVLB which is when Neviweb can't poll the device to get the new data. Sometime it is when Sinopé is doing an update on Neviweb server but that don't take much time and it is normally at night or during weekend. In Neviweb if the device do not respond, the data is not updated but it take more time before Neviweb put a note about unavailable device. When HA poll Neviweb for device data, Neviweb poll the device and if it is not responding we get the error message. I think it's better to know rapidly that something is wrong about one device especially in the peak season. Let me know if you have a better idea. Every suggestion are welcome.

— Reply to this email directly, view it on GitHub < https://github.com/claudegel/sinope-130/issues/185#issuecomment-1805056915>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK5H3T32TJJPCWCXSMJE663YDWSJ5AVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBVGA2TMOJRGU>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/claudegel/sinope-130/issues/185#issuecomment-1807303380, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5H3T5TAWS2MRJUVRMXNILYEFS2TAVCNFSM6AAAAAA63XOQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGMYDGMZYGA . You are receiving this because you authored the thread.Message ID: @.***>

claudegel commented 6 months ago

I'll add this in the comming version of neviweb130.