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
62 stars 13 forks source link
home-assistant home-automation homeassistant neviweb sinope

Home Assistant Neviweb130 Custom Components

Custom components to suport Neviweb devices in Home Assistant. Neviweb is a platform created by Sinopé Technologies to interact with their smart devices like thermostats, light switches/dimmers , load controllers, plug and water leak detector etc.

Neviweb130 will manage the zigbee devices connected to Neviweb via the GT130 gateway and the new wifi devices. It is presently almost up to date with Neviweb but some informations are still missing from Sinopé. As new devices are launched by Sinopé, they are added to this custom-component. If you have a device that is not supported yet, please open an issue and I'll add it rapidly.

Big changes for valve devices

Since version 2.6.2, valves devices are supported as new HA valve entities. They are no longer supported as switch. This will cause all your switch.neviweb130_switch_sedna_valve to be replaced by valve.neviweb130_valve_sedna_valve entities. You will need to revise your automation and cards to retreive your valve entities.

Supported Devices

Here is a list of currently supported devices. Basically, it's everything that can be added in Neviweb.

Prerequisite

You need to connect your devices to a GT130 web gateway and add them in your Neviweb portal before being able to interact with them within Home Assistant. Please refer to the instructions manual of your device or visit Neviweb support.

For wifi thermostats you need to connect your devices to Neviweb and add them in the same network then the GT130 zigbee devices.

There are two custom component giving you the choice to manage your devices via the neviweb portal or directly via local zigbee gateway:

You need to install only one of them but both can be used at the same time on HA. Zigbee devices managed directly via Conbe II must be removed from Neviweb as they cannot be on two networks at the same time.

Neviweb custom component to manage your device via Neviweb portal:

Installation

There are two methods to install this custom component:

To enable Neviweb130 management in your installation, add the following to your configuration.yaml file, then restart Home Assistant.

# Example configuration.yaml entry
neviweb130:
  username: '«your Neviweb username»'
  password: '«your Neviweb password»'
  network: '«your gt130 location name in Neviweb»' (gt130 emplacement dans Neviweb)
  network2: '«your second location name in Neviweb»' (2e emplacement)
  scan_interval: 360
  homekit_mode: False
  stat_interval: 1800

Networks names are the names found on top of first page after loging into Neviweb. If you have more then one network, just click on icon on top to find all networks names. Select the one used for GT130 or wifi devices. Both device type must be on same network to work in neviweb130. If you have two networks for two GT130 or two wifi groups then you can add network2 parameter in your configuration.yaml. See below. You can't mix miwi devices and zigbee/wifi devices on the same network. For miwi devices install Neviweb custom_component which can run along with this custom_component in HA.

network

Configuration options:

key required default description
username yes Your email address used to log in Neviweb.
password yes Your Neviweb password.
network no if not specified, 1st location found is used. Write the name of the GT130 location in Neviweb you want to control. Network name is the location name in Neviweb written on top center of first page, where your wifi or zigbee devices are registered.
network2 no 2nd location found The name of the second location you want to control (zigbee and/or wifi only). Don't add it if you have only one network.
scan_interval no 540 The number of seconds between each access to Neviweb to update device state. Sinopé asked for a minimum of 5 minutes between polling now so you can reduce scan_interval to 300. Don't go over 600, the session will expire.
homekit_mode no False Add support for Homekit specific values. Not needed if you don't use homekit.
stat_interval no 1800 The number of seconds between each access to Neviweb for energy statistic update. Scan will start after 5 minutes from HA startup and will be updated at every 300 to 1800 seconds.

If you have a GT125 also connected to Neviweb the network parameter is mandatory or it is possible that during the setup, the GT125 network will be picked up accidentally. If you have only two GT130/wifi network, you can omit there names as during setup, the first two network found will be picked up automatically. If you prefer to add networs names make sure that they are written «exactly» as in Neviweb. (first letter capitalized or not). Avoid also accented letters as Home Assistant will remove them and location name won't match preventing custom_component loading.

Sedna valve

For Sedna valve there is two way to connect it to Neviweb:

Both mode are supported by this custom component.

Gateway GT130

It is now possible to know if your GT130 is still online of offline with Neviweb via the gateway_status attribute. The GT130 is detected as sensor.neviweb130_sensor_gt130

Custom services

Automations require services to be able to send commande. Ex. light.turn_on. For the Sinopé devices connected via neviweb130, it is possible to use custom services to send specific information to devices or to change some devices parameters. Those custom services can be accessed via development tool/services or can be used in automation:

Catch Éco Sinopé signal for peak period

If you have at least on thermostat or one load controler registered with Éco-Sinopé program, it is now possible to catch when Neviweb send the signal for pre-heating start period for thermostats or turn_off signal for the load controler. Seven attributes have been added for thermostats and three for load controler to know that peak period is comming and how it is managed:

It is then possible to make an automation to set all HA devices ready for peak period by following the eco_status attribute change from «off» to «on».

Statistic for energy

Six attributes are added to track energy usage for devices:

They are polled from Neviweb every 30 minutes. The first polling start 5 minutes after HA restart.

Track energy consumption in HA Energy dashboard

When energy attributes are available, it is possible to track energy consumption of individual devices in Home Assistant energy dashboard by creating a Template sensor in configuration.yaml:

template:
  - sensor:
      - name: "Basement energy usage"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
        state: >-
          {{ state_attr("climate.neviweb130_th1124zb_basement","hourly_kwh_count") }}

or:

template:
  - sensor:
      - name: "Basement energy usage"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total
        state: >-
          {{ state_attr("climate.neviweb130_th1124zb_basement","hourly_kwh") }}

Statistic for Sedna flow sensor

Six attributes are added to track water usage for Sedna valve. They are shown as m³ (cubic meeter) which is what energy module is looking for:

They are polled from Neviweb every 30 minutes. The first polling start 5 minutes after HA restart.

Track water consumption in HA Energy dashboard

When flow attributes are available, it is possible to track water consumption of sedna valve in Home Assistant energy dashboard by creating a Template sensor in configuration.yaml:

template:
  - sensor:
      - name: "Sedna Water Flow"
        unique_id: sensor.sedna_water_flow
        unit_of_measurement: "m³"
        device_class: water
        state_class: total_increasing
        state: >-
          {{ state_attr("valve.neviweb130_valve_water_valve","hourly_flow_count") }}

or:

template:
  - sensor:
      - name: "Sedna Water Flow"
        unique_id: sensor.sedna_water_flow
        unit_of_measurement: "m³"
        device_class: water
        state_class: total
        state: >-
          {{ state_attr("valve.neviweb130_valve_water_valve","hourly_flow") }}

Troubleshooting

if you see your device in the log but it do not apear in entity list you need to add the device model number in the code. Or you can send the model number to me so I can add it in the code.

In the log look for lines:

[custom_components.neviweb130] Received gateway data: [{'id': 100225, 'identifier': '500b91400001f750', 'name': 'Chargeur auto', 'family': '2506',...
[custom_components.neviweb130] Received signature data: {'signature': {'model': 2506, 'modelCfg': 0, 'softBuildCfg': 0, 'softVersion': {'minor': 9, 'middle': 2, 'major': 1}, 'hardRev': 2, 'protocol': 'sinopcom'}}

'family': '2506' and 'model': 2506 is what you need to find the model number of your device. It should be added in climate.py, light.py, switch.py or sensor.py near line 132 to 136 (climate.py) depending on device type. Than restart HA and your device will be listed in entity list.

If you get a stack trace related to a Neviweb130 component in your home-assistant.log file, you can file an issue in this repository.

You can also post in one of those threads to get help:

Turning on Neviweb130 debug messages in home-assistant.log file

To have a maximum of information to help you, please provide a snippet of your home-assistant.log file. I've added some debug log messages that could help diagnose the problem.

Add thoses lines to your configuration.yaml file

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

This will set default log level to warning for all your components, except for Neviweb which will display more detailed messages.

Error messages received from Neviweb

In you log you can get those messages from Neviweb:

Customization

Install Custom-Ui custom_component via HACS and add the following in your code:

Icons for heat level: create folder www in the root folder .homeassistant/www copy the six icons there. You can find them under local/www feel free to improve my icons and let me know. (See icon_view2.png)

For each thermostat add this code in customize.yaml

climate.neviweb_climate_thermostat_name:
  templates:
    entity_picture: >
      if (attributes.heat_level < 1) return '/local/heat-0.png';
      if (attributes.heat_level < 21) return '/local/heat-1.png';
      if (attributes.heat_level < 41) return '/local/heat-2.png';
      if (attributes.heat_level < 61) return '/local/heat-3.png';
      if (attributes.heat_level < 81) return '/local/heat-4.png';
      return '/local/heat-5.png';

In configuration.yaml add this

homeassistant:
  customize: !include customize.yaml

Customization for leak sensor

Same as above. -Create a sensor:

battery_spa:
        friendly_name: "Batterie spa"
        unit_of_measurement: "%"
        value_template: "{{ state_attr('sensor.neviweb130_sensor_spa', 'Battery_level') }}"

-For each leak detector add this to your customize.yaml file

sensor.battery_spa:
  templates:
    entity_picture: >
      if (entity.state < 10) return '/local/battery-1.png';
      if (entity.state < 30) return '/local/battery-2.png';
      if (entity.state < 50) return '/local/battery-3.png';
      if (entity.state < 70) return '/local/battery-4.png';
      return '/local/battery-5.png';
sensor.neviweb130_sensor_spa:    
      if (attributes.Leak_status == "ok") return ''/local/drop.png'';
      return ''/local/leak.png'';'

Icons are availables from www directory. copy them in config/www

Device hard reset:

TO DO

Buy me a coffee

If you want to make donation as appreciation of my work, you can do so via PayPal. Thank you! Support via PayPal