Sinope Line Voltage Thermostats

It look like one of your gt125 or one devuce, switch, is not responding fast enough. That give you the error:
device neviweb switch Pompe: ({‘errorCode’: ‘ReadTimeout’})

This is also why you get the error
IndexError: list index out of range

How many devices do you have on the second network ?
Could you check in your log the lines:

[custom_components.neviweb] Received gateway data:...

this one should list all devices from the first network

[custom_components.neviweb] Received gateway data 2:...

and this one should have devices from the second network

I’ve fixed the list index out of range error if your switch do not respond fast enough

Hi Claude,

I did 2 tests: Network1: Louiseville and Network2: Quebec. Both GT125.

Test 1: Only Network1 seems to be discovered . I only see one ‘received gateway data’ line
Test 2: I inverse Network config. Network1: Quebec and Network 2: Louiseville

The following logs are related with Test2. Even if we specify Quebec as the 1st network , the component selects Louiseville as the first network to load but the ‘received gateway data’ line is getting an error.

Note: I removed sensitive data and replace them with …

2020-05-26 01:51:00 DEBUG (SyncWorker_4) [custom_components.neviweb] Login response: {…}
2020-05-26 01:51:00 DEBUG (SyncWorker_4) [custom_components.neviweb] Successfully logged in
2020-05-26 01:51:01 DEBUG (SyncWorker_4) [custom_components.neviweb] Selecting Louiseville network among: […]
2020-05-26 01:51:01 DEBUG (SyncWorker_4) [custom_components.neviweb] Received gateway data: {‘error’: {‘code’: ‘VALINVLD’, ‘data’: {‘value’: None, ‘name’: ‘location$id’}}}
2020-05-26 01:51:01 DEBUG (SyncWorker_4) [custom_components.neviweb] Gateway_data : {‘error’: {‘code’: ‘VALINVLD’, ‘data’: {‘value’: None, ‘name’: ‘location$id’}}}
2020-05-26 01:51:01 DEBUG (SyncWorker_4) [custom_components.neviweb] Received gateway data 2: […]
2020-05-26 01:51:01 DEBUG (SyncWorker_4) [custom_components.neviweb] Gateway_data2 : […]
2020-05-26 01:51:01 ERROR (MainThread) [homeassistant.setup] Error during setup of component neviweb
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 175, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/neviweb/init.py”, line 44, in setup
data = NeviwebData(hass_config[DOMAIN])
File “/config/custom_components/neviweb/init.py”, line 67, in init
self.neviweb_client = NeviwebClient(username, password, network, network2)
File “/config/custom_components/neviweb/init.py”, line 108, in init
self.__get_gateway_data()
File “/config/custom_components/neviweb/init.py”, line 201, in __get_gateway_data
data = self.get_device_attributes(device[“id”], [ATTR_SIGNATURE])
TypeError: string indices must be integers

Ok look like the network id are mismatch or never picked.

I’ve make changes to get wright network. Please test two way:

first remove the two network name parameter in your config. Neviweb should pick each network automatically. You will see which one come first.

Or put your 2 networks names in parameters but make sure you put them in the same order then Neviweb is sending the answer. You can see in the log
Selecting Louiseville network among: […]
you will see your two networks. Insure that you put the name in the same order as it come from Neviweb.

Do you also have a gt130 connected to Neviweb ? In that case Neviweb will send the three networks names and ID

Hi Claude,

DEBUG (SyncWorker_4) [custom_components.neviweb] Successfully logged in
DEBUG (SyncWorker_4) [custom_components.neviweb] Received gateway data:
DEBUG (SyncWorker_4) [custom_components.neviweb] Gateway_data : [{‘id’
DEBUG (SyncWorker_4) [custom_components.neviweb] Received gateway data 2
DEBUG (SyncWorker_4) [custom_components.neviweb] Gateway_data2

After settings component for the 1st Gateway:

Got the following ERROR blocking Gateway_data2 to be discovered

2020-05-26 18:48:54 ERROR (MainThread) [homeassistant.components.light] Error while setting up neviweb platform for light
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/config/custom_components/neviweb/light.py”, line 63, in async_setup_platform
devices.append(Neviweb2Light(data, device_info, device_name))
NameError: name ‘Neviweb2Light’ is not defined

Just have 2 networks with GT125. Not GT130 connected on Neviweb

Hopefully I’ve removed the last «2»

I’ve updated the documentation to be ready once it work.

Hi Claude, Great work…no more errors. I can see both networks and controlling components. I’ve done some testing and controling without any issue. Yaml config includes only the following:

neviweb:
username: !secret neviweb_username
password: !secret neviweb_password
scan_interval: 360

Thx very much. My next integration is Sinope Wate at one location: Do have something in dev?

I’m very happy that it is working.

By Sinope Wate, do you mean Sinope Waterleak ?
The water sensors are already working in my neviweb130 app that manage the GT130. (claudegel/sinope-130). I should test if the valve will work. I already have the valve and 5 sensors.
With the sensors in HA, you get the water leak alarm, battery level of the sensors and room temperature where the sensor is located.
Sinopé is telling me that the waterleak app will be merge in Neviweb.
For now I’ll do a little code cleanup and if you still get no error after few days I’ll merge it to claudegel/sinope-1

Thank you for your patience

Yes Claude. Typo. I mean Sinope Waterleak? I have one Sinope water Valve and one smart leak detector. Valve is connected wifi for now considering that I have only the GT125 at this location. Since the product launch that Sinope is saying that waterleak app will be merge to neviweb. No rush

Could you do another test for me. In your config add the two lines for your networks names like this:

neviweb:
  username: !secret neviweb_username
  password: !secret neviweb_password
  network: your_network_1_name
  network2: your_network_2_name
  scan_interval: 360

This is to test if, that way, your two network will be discovered. If somebody have a GT130 and one or two GT125 we must insure that only the the GT125 network will be selected. In that case we must give the name of the networks we want to load.

The other way, with no network name in the config, will work if you have only one or two GT125 connected to Neviweb and no GT130. If everything is OK I’ll merge this branch and start doing the same for those who have two GT130 connected to Neviweb.

Thank you

No problem : Test results with the following.

neviweb:
username: !secret neviweb_username
password: !secret neviweb_password
network: ‘Louiseville’
network2: ‘Quebec’
scan_interval: 360

2020-05-28 01:18:37 ERROR (MainThread) [homeassistant.setup] Error during setup of component neviweb
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 175, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/neviweb/init.py”, line 44, in setup
data = NeviwebData(hass_config[DOMAIN])
File “/config/custom_components/neviweb/init.py”, line 67, in init
self.neviweb_client = NeviwebClient(username, password, network, network2)
File “/config/custom_components/neviweb/init.py”, line 107, in init
self.__get_network()
File “/config/custom_components/neviweb/init.py”, line 158, in __get_network
if network[0][“name”] == self._network_name:
KeyError: 0

I’ve patched for network selection. It should work now.

2020-05-28 02:16:24 DEBUG (SyncWorker_9) [custom_components.neviweb] Received gateway data: {‘error’: {‘code’: ‘VALINVLD’, ‘data’: {‘value’: None, ‘name’: ‘location$id’}}}
2020-05-28 02:16:24 DEBUG (SyncWorker_9) [custom_components.neviweb] Gateway_data : {‘error’: {‘code’: ‘VALINVLD’, ‘data’: {‘value’: None, ‘name’: ‘location$id’}}}
2020-05-28 02:16:24 ERROR (MainThread) [homeassistant.setup] Error during setup of component neviweb
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 175, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/neviweb/init.py”, line 44, in setup
data = NeviwebData(hass_config[DOMAIN])
File “/config/custom_components/neviweb/init.py”, line 67, in init
self.neviweb_client = NeviwebClient(username, password, network, network2)
File “/config/custom_components/neviweb/init.py”, line 99, in init
self.__get_gateway_data()
File “/config/custom_components/neviweb/init.py”, line 192, in __get_gateway_data
data = self.get_device_attributes(device[“id”], [ATTR_SIGNATURE])
TypeError: string indices must be integers

Could you send me your log for the network starting by :slight_smile:
[custom_components.neviweb] Selecting network_name network among: [{'id': 12799, 'location$id': None, 'name': 'network_name', ...

Change the network ‘louiseville’ by ‘Louiseville’: (no error) but Network 2 is no longer discovered as a gateway.

2020-05-28 03:04:33 DEBUG (SyncWorker_14) [custom_components.neviweb] Login response: {‘user’: {‘id’: 11901, ‘role’: ‘owner’, ‘email’: ’ ', ‘locale’: ‘fr’, ‘format’: {‘time’: ‘24’, ‘temperature’: ‘c’}}, ‘account’: {‘id’: 12133, ‘interface’: ‘neviweb’, ‘type’: ‘free’}, ‘iat’: 1590635073197, ‘session’: ‘7e82e02fc5fc9d08dbff39bed21589e2ede46740193b184e’, ‘refreshToken’: ‘69133a99dae87a52bf4e16aed5f251c5a31c4662b138105ad9b0adb3bd46c1cd1d2ac34ec5d8e576d53b82b31ed02b75’}
2020-05-28 03:04:33 DEBUG (SyncWorker_14) [custom_components.neviweb] Successfully logged in
2020-05-28 03:04:33 DEBUG (SyncWorker_14) [custom_components.neviweb] Selecting Louiseville network among: [{‘id’: 12702, ‘location$id’: None, ‘name’: ‘Louiseville’, ‘postalCode’: ‘’, ‘mode’: ‘home’, ‘icon’: 3, ‘kwhCost’: 0.087, ‘deviceListUpdate’: ‘2020-05-26 16:44:48’, ‘modified’: ‘2020-03-17 10:53:56’, ‘created’: ‘2019-08-20 17:23:12’}, {‘id’: 12703, ‘location$id’: None, ‘name’: ‘Quebec’, ‘postalCode’: ‘’, ‘mode’: ‘home’, ‘icon’: 1, ‘kwhCost’: 0.0871, ‘deviceListUpdate’: ‘2020-02-19 07:53:50’, ‘modified’: ‘2019-11-02 01:41:27’, ‘created’: ‘2019-08-20 17:23:12’}]
2020-05-28 03:04:33 DEBUG (SyncWorker_14) [custom_components.neviweb] Received gateway

Error with the lastest code:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 279, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 472, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/neviweb/switch.py”, line 89, in update
device_daily_stats[0] is not None else 0
IndexError: list index out of range

I think I’ve fix it. I was stopping network discovery after the first one. So if network parameter correspond to the first discovered you were getting one network discovered but the discovery was stopping after that first one. If your network parameter wasn’t corresponding to the first discovered nothing was getting discovered.

I’ve added more logging so it is possible to compare the network name you put in your config with the network names discovered. To avoid error like «louiseville» and «Louiseville» if the name don’t match.