Sinope Line Voltage Thermostats

Bonjour Claude,
your code seems to work, no compile error reported:

image

The next step with this code would be to add parameters to it like this :

      {% set angle = states('sensor.sinope_technologies_lm4110_zb_angle') | float(0) %}
      {% set x_min = 110 %}
      {% set x_max = 406 %}
      {% set delta = 46 %}
      {% set low = 10 %}
      {% set high = 80 %}

And replace the numerical values in the formula with these parameters. This make the formula easier to understand and easier to change from a 10-80 to 5-95 gauge. However, I have not been able to get these parameters to be used successfully yet.

I’ll further investigate and let you know. If you are successfull on your side, please let me know.

Bonjour Claude,

I think I’ll add to my code an “offset” parameter to account for the “gap” seen in between the actual reading (73%) of the gauge and the calculated value (70%). This will ensure that the calculated value is the same than the actual reading.

What do you think?

Bonjour Claude,

after some experiments, here is the updated code, with “parameters”, including the “offset”, to take into account differences in the gauge reading and reported value:

# Calculates propane tank % according to value returned by Sinope device (for R3D 10-80 gauge)
template:
  - trigger:
    - platform: time_pattern
      hours: "/5"
  - sensor:
    - name: "Tank remaining level"
      unit_of_measurement: "%"
      icon: mdi:propane-tank
      state: >
          {% set angle = states('sensor.sinope_technologies_lm4110_zb_angle') | float %}
          {% set x_min = 110 | float %}
          {% set x_max = 406 | float %}
          {% set delta = 46 | float %}
          {% set low = 10 | float %}
          {% set high = 80 | float %}
          {% set offset = 3 | float %}
         
          {% if ((delta <= angle) and (70 >= angle)) %}
            {{ (((delta-110)/(x_max-x_min)*(high-low))+low+offset) | round(0) }}
          {% elif ((0 <= angle) and (delta > angle)) %}
            {{ (((angle)+360-x_min)/(x_max-x_min)*(high-low)+low+offset) | round(0) }}
          {% else %}
            {{ (((angle)-x_min)/(x_max-x_min)*(high-low)+low+offset) | round(0) }}
          {% endif %}  

Works fine as per below:
image

Hope this will be usefull to others.

With your offset I get 63% and my gauge is at 62%. So I think that the offset is not linear.
But ±1 % is a good start.
It would be very interesting if we can merge both 10-80 and 5-95 in the same template so the user will have just to set on parameter, gauge type 5-95 or 10-80. No need to touch other parameters.

here is a merge for both 10-80 and 5-95 gauge. Only one line to chage:
{% set gauge = “10-80” %} or {% set gauge = “5-95” %}

template:
  - trigger:
    - platform: time_pattern
      hours: "/5"
  - sensor:
    - name: "Tank remaining level"
      unit_of_measurement: "%"
      icon: mdi:propane-tank
      state_class: measurement
      state: >
        {% set gauge = "10-80" %}
        {% set angle = states('sensor.sinope_technologies_lm4110_zb_angle') | float %}
        {% set x_min = 110 | float %}
        {% set offset = 3 | float %}
        {% if (gauge == "10-80") %}
          {% set x_max = 406 | float %}
          {% set delta = 46 | float %}
          {% set low = 10 | float %}
          {% set high = 80 | float %}
        {% else %}
          {% set x_max = 415 | float %}
          {% set delta = 55 | float %}
          {% set low = 5 | float %}
          {% set high = 95 | float %}
        {% endif %}

        {% if ((delta <= angle) and (70 >= angle)) %}
          {{ (((delta-110)/(x_max-x_min)*(high-low))+low+offset) | round(0) }}
        {% elif ((0 <= angle) and (delta > angle)) %}
          {{ (((angle)+360-x_min)/(x_max-x_min)*(high-low)+low+offset) | round(0) }}
        {% else %}
          {{ (((angle)-x_min)/(x_max-x_min)*(high-low)+low+offset) | round(0) }}
        {% endif %}

Good one Claude! Well done! :slight_smile:

Regarding the “offset” parameter, I suggest that it has to be set by the user, to “compensate” the accuracy of the gauge vs sensor. In my case, a value of 3 gives an exact reading while in your case, the offset should be 2.

Regarding the code, I just found out a quick fix to be made:

replace:

{% if ((delta <= angle) and (70 >= angle)) %}
          {{ (((delta-110)/(x_max-x_min)*(high-low))+low+offset) | round(0) }}

by:

{% if ((delta <= angle) and (70 >= angle)) %}
          {{ (((delta-x_min)/(x_max-x_min)*(high-low))+low+offset) | round(0) }}

I think it is good to go! :slight_smile:

Ok for the quick fix. I also think that we should have a separate parameter for gauge type and offset value until we found a fix for the offset value depending on the tank level.
I’ve updated my readme.md to add the setup for gauge type and offset parameter setting as parameter outside the calculation template.

Anybody can recommend a good z-wave stick for HA?

Hello!

I am a bit new to HA. I am just setting everything up.
I have 2 Sinopé TH1123WF thermostats I am trying to integrate - no GT130.

I understand from your docs I can use the Neviweb130 Custom Component, but I am having a bit of trouble.

My config:

 neviweb130:
   username: '<[email protected]>'
   password: '<*******>'
   network: '<75703>'   
   scan_interval: 360
   homekit_mode: False
   stat_interval: 1800

For “network” I have tried the literal name of the location as well, as well as no network entry at all (I only have one location) but no joy.

My logs:

This error originated from a custom integration.

Logger: homeassistant.setup
Source: custom_components/neviweb130/__init__.py:243
Integration: neviweb130 (documentation)
First occurred: September 8, 2023 at 6:38:17 PM (1 occurrences)
Last logged: September 8, 2023 at 6:38:17 PM

Error during setup of component neviweb130
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 136, in setup
    data = Neviweb130Data(hass_config[DOMAIN])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 168, in __init__
    self.neviweb130_client = Neviweb130Client(username, password, network, network2)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 198, in __init__
    self.__get_network()
  File "/config/custom_components/neviweb130/__init__.py", line 243, in __get_network
    raw_res = requests.get(LOCATIONS_URL + self._account, headers=self._headers,
                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Can you advise?
Thanks in advance

For the TH1123WF, you don’t need the GT130 as they are wifi devices that connect directly to Neviweb.

network: '<75703>'

you should put the name of your network (location) in Neviweb not the number. You’ll find it at the top of the page after logging into Neviweb.
neviweb

Don’t put the bracket < > just

username: '[email protected]'
password: '*******'
network: 'location_name'

for better security you can place email and password in the file secrets.yaml

configuration.yaml:
username: !secret climate_username

secrets.yaml:
climate_username: ‘[email protected]’

1 Like

Ah the Brackets!

I had tried the name (not the number) already - but I don’t know where those brackets got into my head for.
Brilliant, will do. Thank you.

I’ve changed the doc and replaced the < > by « »
Should be more obvious :slight_smile:

Hi @claudegel

For the Sinopé Calypso, do you know what the tank size settings in Neviweb (40/50/60/80 gal) is for? How does this affect the way Calypso is working?

I’m trying to read attribute 19 (tankSize) from cluster 0xff01 that is liste on your attributes table for the Calypso but using zigbee2mqtt and it says that this is an unsupported attribute for calypso
image

The others attribute are reading fine, i,e drConfigWaterTempMin is at 45 and I can adjust it

Est-ce que ca vaut la peine d’essayer d’ajuster cet attribut Ă  la bonne valeur ou je me casse la tĂȘte pour rien?

Merci

Hi @Alain_Raymond
you are using zigbee2mqtt and the attribute 19 is not defined in the zigbee-herdsman cluster.ts
It should be added there to be supported. I’ll send a PR to them.
The use of tankSize is probably for heating time calculation or something like that. I’ll ask to SinopĂ©. If I get an answer I’ll tell you.

Thanks Claude,

I already made a PR to update the zcl of z2m (cluster.ts) in zigbee-herdsman earlier this week. Its not merged yet. Koen asked me to test it before by editing the cluster.ts file on my installation. I did and now im able to poll this attribute from the dev console but it only returns that its not supported, I was expecting to get a number from 1 to 4. It worked fine when I added drConfigWaterTempMin a few months ago, so I dont understand why tankSize is not.

SinopĂ© are giving great customer services except for these things. Last time I contacted them, they refused to give me the attribute and cluster number for drConfigWaterTempMin (but the guy was kind enough to give me hints that someone (you) compiled a list of their attributes on github, that’s how I found your repo). Already asked them what tankSize is doing, no answer yet.

Hi @Alain_Raymond, Sinopé answer me that for now this parameter it not used at all. :frowning:

1 Like

Thanks for your answer!
Im curious to know if you or someone else was able to poll this attribute?

As it is defined in ZHA it should be possible to detect it. I’ll switch mine from neviweb to zha and let you know

1 Like

Hi everybody, is there any documentation somewhere to understand how to template the wifi thermostats with no local gateways ? I tried many solutions, nothing works yet. I am connected to the neviweb API, but I don’t how to see the thermostats / sensors
 I think I am struggling with the naming convention in the yaml file essentially.
The connection to neviweb works though:

neviweb:
  username: <username>
  password: <password>
  network: 'Maison'
  scan_interval: 300

Any guidance or link to a documentation to see my thermostats in the dev tools state list would help.
Thx

Hi @thomas_g you just pick the wrong custom component.
neviweb is for the miwi devices connected to the GT125
neviweb130 is for the zigbee connected to the GT130 and wifi devices
First use hacs to install the neviweb130 integration
follow the doc at GitHub - claudegel/sinope-130: Neviweb custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
in configuration.yaml add this:

neviweb130:
  username: <username>
  password: <password>
  network: 'Maison'
  scan_interval: 300
  stat_interval: 600

you can also add this for debug purpose:

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

Let me know if it work or not