Sinope Line Voltage Thermostats

Bonjour Claude,
thanks for your precious work about Sinope devices. I just ordered the LM4110-ZB for my propane tank and I am hopefull to get it working with Home Assistant, altough Sinope told me in an e-mail exchange that it is not supported. I’ll try it as soon as I’ll get it and report any problem with it.

Bonjour Étienne,
just ordered my Sinope tank level monitor today. Following this post, have you been able to get the % value reported correctly? If yes, how?
Thanks!

I have not. This is low priority on my list of things to do since the fireplace has been off for months. I will have a look in the fall most likely and post the results here.

Presently the LM4110-ZB is supported in HA via my neviweb130 custom_component for sensor connected to Neviweb via the Gt130.
It is also supported in ZHA in sinope/sensor.py.
For the gauge needle angle it is the cluster 0x000C, analog_input, attribute 0x0055.
we need to activate reporting on this cluster attribute to receive the angle change.Then it will be easy to create a template sensor to convert angle to % value.
You need to know the gauge type you have on your propane tank. 5 to 95 % or 10 to 80 %
As I’m back from vacation I’ll disconnect my LM4110-ZB from neviweb and connect back to HA via ZHA. Then I’ll figure how to activate the reporting.

LM4110-ZB are sleepy devices. That mean they can’t receive command when they are sleeping. So to be able to send conf_report you need to send it repeatedly, at least 100 times. That is zha will send the command a hundred times and we hope that during that period the LM4110 with be awake and receive the comande.

The correct command is :

service: zha_toolkit.execute
data:
  ieee: «your LM4110 ieee»
  command: conf_report
  endpoint: 1
  cluster: 0x000c
  attribute: 0x0055
  min_interval: 5
  max_interval: 3757
  reportable_change: 1
  tries: 100
  event_done: zha_done

Check your log until you get :

'success': True, 'result_conf': [[ConfigureReportingResponseRecord(status=0)]]

zha-toolkit will submit the command until it reach 100 retry or zha_done event.

Once you have it correctly, you need to bind your LM410ZB to your
zigbee gateway so the report is sent to the correct place:

service: zha_toolkit.bind_ieee
data:
  ieee: «your LM4110 ieee»
  command_data: «your zigbee gateway iee»
  cluster: 0x000c
  endpoint: 1
  dst_endpoint: 1
  tries: 100
  event_done: zha_done

service: zha_toolkit.execute can be replaced by service: zha_toolkit.conf_report. In the last case remove the command: conf_report line.
The most important is to retry many time to catch the moment the LM4110 is awake.

Hello Claude,

I do have the same problem than grammo (not getting the angle value). I am using LM4110-ZB without the GT-130 gateway. I have followed the steps you explained to enable reporting and bind the zigbee controller. Here is the information I am getting so far:

  1. Connecting LM4110-ZB worked fine. HA recognized the device few seconds after putting batteries in it.
  2. When getting into the device page, only temperature and battery values are displayed:
    Capture1
  3. Then going into “Development Tools”, and “Services”.
  4. Calling service with the first set of code “conf_report”, with the following response:
zha_toolkit_version: v0.9.7
zigpy_version: 0.56.4
zigpy_rf_version: 0.35.9
ieee_org:
  - 142
  - 25
  - 165
  - 254
  - 255
  - 101
  - 17
  - 44
ieee: 2c:11:65:ff:fe:a5:19:8e
command: conf_report
command_data: null
start_time: "2023-08-21T18:48:19.301348+00:00"
errors: []
params:
  endpoint_id: 1
  cluster_id: 12
  attr_id: 85
  min_interval: 5
  max_interval: 3757
  reportable_change: 1
  dir: 0
  tries: 100
  expect_reply: true
  args: []
  event_done: zha_done
  read_before_write: true
  read_after_write: true
success: true
result_conf:
  - - status: 0
      direction: null
      attrid: null
  1. Calling service with the second set of code “bind_ieee”, with the following response:
zha_toolkit_version: v0.9.7
zigpy_version: 0.56.4
zigpy_rf_version: 0.35.9
ieee_org:
  - 142
  - 25
  - 165
  - 254
  - 255
  - 101
  - 17
  - 44
ieee: 2c:11:65:ff:fe:a5:19:8e
command: bind_ieee
command_data: e0:79:8d:ff:fe:99:95:56
start_time: "2023-08-21T18:50:08.286412+00:00"
errors: []
params:
  endpoint_id: 1
  dst_endpoint_id: 1
  cluster_id: 12
  dir: 0
  tries: 100
  expect_reply: true
  args: []
  event_done: zha_done
  read_before_write: true
  read_after_write: true
result:
  "1":
    src_endpoint_id: 1
    dst_endpoint_id: 1
    cluster_id: 12
    result:
      - 0
success: true
  1. Both service reponses seemed to be succesfull. However, even after restarting HA, still no angle reading reported as an entity… There is probably something that I have not done right. :roll_eyes:

Thanks!

Fine. the LM4110-ZB will send report to your zigbee gateway when the needle angle change or every 3757 seconds.
This data won’t appear in the device page. You willneed to create an automation that will watch for the report and populate a template sensor for the needle angle. Then it will be easy to do the calculation to transfer angle to %. let me dig a little and I’ll come back with the complete solution.

1 Like

Merci Claude, appreciated.

Other pertinent info, my tank scale is 10-80. Current % value read on dial is around 74 as per picture below:

There are two models 10-80 and 5-95. You will need that info when performing needle angle to % calculation.
To get the angle value you can try this method:

- platform: sql
  db_url: sqlite:////config/zigbee.db
  scan_interval: 10
  queries:
    - name: current_angle
      query: "SELECT value FROM attributes_cache_v7 where ieee = 'your LM4110 ieee' and cluster = 12 and attrid = 85"
      column: "value"

you need to add sql integration and after you should see the value in sensor.current_angle.
Try and let me know

Another way to read the angle value is like this if you don’t want to install the sql component.

service: zha_toolkit.execute
data:
  command: attr_read
  ieee: «your LM4110 ieee»
  cluster: 0x000c
  attribute: 0x0055
  state_id: sensor.current_angle
  allow_create: True
  tries: 100

This service will try to read the angle value a 100 times and stop after that amount of time or when it get the value. It will then create a sensor.current_angle if it don’t already exist and copy angle value in the sansor. As the LM4110-ZB is a sleeping device it cannot receive command when sleeping. Retrying many times give the possibility to send command when the device wake up to send his report.
It is possible to create an automation to activate that service every hours or as you like to update the value.

I’ll update my sinope-zha doc to add all info about the LM4110-ZB configuration for ZHA.

Bonjour Claude,
indeed this method works well for me, I tested it couple of days ago. I have been able to get the angle value to get assigned to a new “state” and get it displayed on my dashboard.

Only remaining steps that I’ll have to work out sometimes in the next days are the following:

  1. automate the request to send the command every x minutes to get the value refreshed
  2. setup the calculation to convert the returned value into the right % remaining

I’ll let confirm the results of these tests shortly.

Thanks!

I’m almost finished with the % calculation in an automation.
Anybody noticed that neviweb130 do not restart on HA restart. Look like Neviweb change some attribute which prevent neviweb130 from restarting. I’ll push a quick fix today and make a complete cleanup this weekend

Bonjour Claude,

after some trial and errors, I have been successfull to:

  1. get the LM4110-ZB level sensor value to be reported
  2. automate the attribute read once every hour
  3. convert the sensor returned value into a % value

Code for automating the value reading (added to automations.yaml):

- id: '1692841759194'
  alias: Lecture niveau propane
  description: Lecture du niveau de réservoir à chaque heure
  trigger:
  - platform: time_pattern
    hours: /1
  condition: []
  action:
  - service: zha_toolkit.execute
    data:
      command: attr_read
      ieee: "you ieee value"
      cluster: 12
      attribute: 85
      state_id: sensor.sinope_technologies_lm4110_zb_level
      allow_create: true
      tries: 100
  mode: single

Code for converting the tank level value into % for gauge 10-80 (added to configuration.yaml) as per the indications you have provided:

template:
  - sensor:
    - name: "Tank remaining level"
      unit_of_measurement: "%"
      state: >
        {{ (((states('sensor.sinope_technologies_lm4110_zb_level') | float(0))-1.1)/(4.06-1.1)*(80-10)+10) | round(0) }}
      availability: >
        {{ states('sensor.sinope_technologies_lm4110_zb_level') | is_number }} 

The value returned by the attr_read service is 5.0 for a actual gauge reading of 74%. Does not seem right… According to Sinope, the value returned by the LM4110-ZB should be a float between 0 and 359 which represent an angle.

Do you have an idea of where the problem could be?

Thanks!

Hello Claude,
after some verifications, I’ll check as I used to get a value of 287 instead of 5. So the problem must be on my side. A value of 287 would make more sense. I’ll check and get back shortly.

Hello Claude,

I have found the problem. It seems that the angle value of 5.0 is correct. With proper calculation according to your indications, it returns a value of 70% which is close to the 74% value read directly on the gauge.

image

Getting very close to the end result! :slight_smile:

Bonjour,

Le fix ne fonctionne pas chez moi.


Hi sorry for the bug. Sinopé is shaking the Neviweb code and many attributes are removed or renamed.
I just forget to change the line 1126 in climate.py
«elif» should be «if» so you can edit climate.py and remove the «el» if front of the if on line 1126.
elif should be if, make sure the indentation is correct. The if should be aligned with the elif below.
You can also copy the file climate.py in the master branch I’ve made the correction.
If nobody report other error I’ll push a new version tonight.

1 Like

Hello Claude,

I think my configuration is working fine now:
image

  1. code into automation.yaml to read the sensor value every hour:
- id: '1692841759194'
  alias: Lecture niveau propane
  description: Lecture du niveau de réservoir à chaque heure
  trigger:
  - platform: time_pattern
    hours: /1
  condition: []
  action:
  - service: zha_toolkit.execute
    data:
      command: attr_read
      ieee: "my ieee device id"
      cluster: 12
      attribute: 85
      state_id: sensor.sinope_technologies_lm4110_zb_angle
      allow_create: true
      tries: 100
  mode: single
  1. code to convert the angle value into a %, updated every 5 minutes (for 10-80 gauge):
# 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: >
          {% if ((46 <= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0)) and (70 >= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))) %}
            {{ (((46-110)/(406-110)*(80-10))+10) | round(0) }}
          {% elif ((0 <= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0)) and (46 > states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))) %}
            {{ (((states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))+360-110)/(406-110)*(80-10)+10) | round(0) }}
          {% else %}
            {{ (((states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))-110)/(406-110)*(80-10)+10) | round(0) }}
          {% endif %}   

The last code for conversion is not optimal as I could have set values and use those in the formulas. But works for now. I’ll probably improve the code later on.

I am curious to compare with the code you are getting for angle to % conversion.

Thanks!

@roydo can you test that code:

template:
  - trigger:
    - platform: time_pattern
      hours: "/5"
  - sensor:
    - name: "Tank remaining level"
      unit_of_measurement: "%"
      icon: mdi:propane-tank
      state: >
          {% if ((46 <= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0)) and (70 >= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))) %}
            {{ ((((46-110)/296)*70)+10) | round(0) }}
          {% elif ((0 <= states('sensor.sinope_technologies_lm4110_zb_angle') | float(0)) and (46 > states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))) %}
            {{ (((((states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))+360-110)/296)*70)+10) | round(0) }}
          {% else %}
            {{ (((((states('sensor.sinope_technologies_lm4110_zb_angle') | float(0))-110)/296)*70)+10) | round(0) }}
          {% endif %}

I’ve put all instructions to setup LM4110-ZB tank level monitor to report tank % level in my sinope-zha readme.md