Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.76k stars 1.64k forks source link

[New device support]: Equation pilot wire and consumption measurement #19169

Closed yoan-m closed 10 months ago

yoan-m commented 11 months ago

Link

https://www.leroymerlin.fr/produits/chauffage-et-ventilation/radiateur/radiateur-electrique/kit-de-demarrage-economie-energie/recepteur-connecte-chauffage-fil-pilote-87766424.html

Database entry

{
   "id":2,
   "type":"Router",
   "ieeeAddr":"0x187a3efffeb1f880",
   "nwkAddr":1984,
   "manufId":4727,
   "manufName":"Adeo",
   "powerSource":"Mains (single phase)",
   "modelId":"SIN-4-FP-21_EQU",
   "epList":[
      1,
      242
   ],
   "endpoints":{
      "1":{
         "profId":260,
         "epId":1,
         "devId":81,
         "inClusterList":[
            0,
            3,
            4,
            5,
            6,
            1794,
            4096,
            64512
         ],
         "outClusterList":[
            25
         ],
         "clusters":{
            "genBasic":{
               "attributes":{
                  "modelId":"SIN-4-FP-21_EQU",
                  "manufacturerName":"Adeo",
                  "powerSource":1,
                  "zclVersion":8,
                  "appVersion":3,
                  "stackVersion":103,
                  "hwVersion":20,
                  "dateCode":"2021"
               }
            },
            "haElectricalMeasurement":{
               "attributes":{

               }
            },
            "genOnOff":{
               "attributes":{
                  "onOff":0
               }
            },
            "piAnalogInputReg":{
               "attributes":{

               }
            }
         },
         "binds":[
            {
               "cluster":6,
               "type":"endpoint",
               "deviceIeeeAddress":"0x00212effff048357",
               "endpointID":1
            },
            {
               "cluster":2820,
               "type":"endpoint",
               "deviceIeeeAddress":"0x00212effff048357",
               "endpointID":1
            },
            {
               "cluster":64576,
               "type":"endpoint",
               "deviceIeeeAddress":"0x00212effff048357",
               "endpointID":1
            }
         ],
         "configuredReportings":[
            {
               "cluster":6,
               "attrId":0,
               "minRepIntval":0,
               "maxRepIntval":3600,
               "repChange":0
            }
         ],
         "meta":{

         }
      },
      "242":{
         "profId":41440,
         "epId":242,
         "devId":102,
         "inClusterList":[
            33
         ],
         "outClusterList":[
            33
         ],
         "clusters":{

         },
         "binds":[

         ],
         "configuredReportings":[

         ],
         "meta":{

         }
      }
   },
   "appVersion":3,
   "stackVersion":103,
   "hwVersion":20,
   "dateCode":"2021",
   "zclVersion":8,
   "interviewCompleted":true,
   "meta":{

   },
   "lastSeen":1696430383834,
   "defaultSendRequestWhen":"immediate"
}

Comments

It will probably looks like Legrand 064882

External converter

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['SIN-4-FP-21_EQU'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'SIN-4-FP-21_EQU', // Vendor model number, look on the device for a model number
    vendor: 'Adeo', // Vendor of the device (only used for documentation and startup logging)
    description: 'Cable outlet with pilot wire and consumption measurement', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [ fz.on_off, fz.metering/*fz.electrical_measurement, fz.power_on_behavior,fz.legrand_cluster_fc01, fz.legrand_cable_outlet_mode, fz.on_off, fz.electrical_measurement, fz.metering, fz.power_on_behavior*/],
    toZigbee: [tz.on_off/*tz.legrand_deviceMode, tz.legrand_cableOutletMode, tz.on_off, tz.electrical_measurement_power, tz.power_on_behavior*/],
    exposes: [e.switch().withState('state', true, 'Works only when the pilot wire is deactivated'),
               e.power().withAccess(ea.STATE_GET),
             // e.power(),
              e.binary('device_mode', ea.ALL, 'pilot_on', 'pilot_off'),
            e.enum('cable_outlet_mode', ea.ALL, ['comfort', 'comfort-1', 'comfort-2', 'eco', 'frost_protection', 'off']),
            /*e.power_apparent(),
            e.power_on_behavior().withDescription(`Controls the behavior when the device is powered on. Works only when the pilot wire is deactivated`)
            e.switch().withState('state', true, 'Works only when the pilot wire is deactivated'),
            e.power().withAccess(ea.STATE_GET),
              e.power(), e.energy(),
            e.power_apparent(),
            e.power_on_behavior().withDescription(`Controls the behavior when the device is powered on. Works only when the pilot wire is deactivated`)*/],
    configure: async (device, coordinatorEndpoint, logger) => {
      const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'genAnalogInput'/*, 'seMetering'*/]);
            await reporting.onOff(endpoint);
            await endpoint.read('genAnalogInput', ['presentValue']);
            //await reporting.activePower(endpoint);
            //await reporting.currentSummDelivered(endpoint);
           // await reporting.readMeteringMultiplierDivisor(endpoint);
    },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

hcharbonnier commented 11 months ago

This device seems to be the Nodon SIN-4-FP-21. The only reference on nodon website is on this page: https://nodon.fr/gateway-compatibility/

yoan-m commented 11 months ago

I'm able to metering & On/Off now but I don't know how to change the heat mode. Any idea ?

hcharbonnier commented 11 months ago

Maybe a clue to change heat mode (but I can't test because I don't have the device yet).

Nodon have an other device to manage pilot wire heater but with enocean protocol. On the enocean device to change the heating mode you just have to use the same command as to turn your heater on/off, but send different values. Maybe the zigbee device works the same way: 0 for Off, 1 for Comfort, 2 for Eco, 3 for Anti-Freeze, 4 for Comfort-1 and 5 for Comfort-2.

Source (french website): https://forum.jeedom.com/viewtopic.php?t=26825#p547979

Also I think comfort-1 and comfort-2 mode doesn't really have a meaning, because in pilot wire protocol, the command may take up to 5 minutes to be processed: Source also in french: http://www.radiateur-electrique.org/fil-pilote-radiateur.php#:~:text=Les%20signaux%20%22confort%20%2D1%C2%B0,un%20d%C3%A9lai%20de%205%20minutes.

yoan-m commented 11 months ago

It seems to be on cluster 0xfc00 but i'm not able to find the type and format

yoan-m commented 11 months ago

I have some data on 0xfc00 Received Zigbee message from '0x187a3efffeb1f880', type 'attributeReport', cluster 'manuSpecificUbisysDeviceSetup', data '{"inputConfigurations":1}' from endpoint 1 with groupID null

yoan-m commented 11 months ago

When I turn on the module, 1::64512::0 is set to 1, and when I turn off 1::64512::0 is set to 3. Now I would like to manualy change this value to control the pilot wire. I tried to create a toZigbee function and write on the cluster without succes

embryooo commented 11 months ago

Hi, I'm new to HA with Z2M but would like to manage my heaters with this device. I bought one but it's not supported obviously. It appears as SIN-4-FP-21_EQU from Adeo.

image

If I can help by testing it's with pleasure (unfortunately don't ask me to code plz 👎 )

hcharbonnier commented 11 months ago

We may get hint on the device configuration at this URL: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/7280

Zoa-home commented 10 months ago

Hi, I'm new to HA with Z2M but would like to manage my heaters with this device. I bought one but it's not supported obviously. It appears as SIN-4-FP-21_EQU from Adeo.

image

If I can help by testing it's with pleasure (unfortunately don't ask me to code plz 👎 )

Follow this link : Support new devices

and replace example by @yoan-m code "External converter"

yoan-m commented 10 months ago

Hi, I just received an email from nodon company.

Integration is in progress. It will be done within a few days.

hcharbonnier commented 10 months ago

Hi, I just received an email from nodon company.

Integration is in progress. It will be done within a few days.

Same here

yoan-m commented 10 months ago

It's moving here https://github.com/Koenkk/zigbee-herdsman-converters/pull/6381

pipiche38 commented 10 months ago

+1

krikristoophe commented 10 months ago

Hello @yoan-m and others. Both pending PRs (https://github.com/Koenkk/zigbee-herdsman/pull/796 and https://github.com/Koenkk/zigbee-herdsman-converters/pull/6434) allow to change mode of SIN-4-FP-21-EQU ! Just waiting feedback or merge.

Zigbee infos

I write Zigbee infos of the module here if anyone need them one day :

data

yoan-m commented 10 months ago

Thanks @krikristoophe, here is the PR for the SIN-4-FP-21 from NodOn https://github.com/Koenkk/zigbee-herdsman-converters/pull/6429 It seems to be the same device

krikristoophe commented 10 months ago

Hello everyone The PR that integrate this device has been merged. But it look like that not working because of the bad payload sent to Zigbee 🥲

I will make another PR to fix this !

yoan-m commented 10 months ago

Work in progress here

syl20cjs commented 9 months ago

Hello I successfully pair it on zigbee2mqtt, I Can see the consumption value on home assistant but I am not able to change the state or to use the switch...

It works when I push the physical button to change mode.

Is there a solution ?

Here are the logs I have in case of an error Error 2023-12-08 19:56:48Publish 'set' 'state' to 'radiateur_leo' failed: 'Error: Command 0xf4b3b1fffeb3e52b/242 genOnOff.on({}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 32138 - 242 - 165 - 6 - 11 after 10000ms)'

Regards

carlofrancese commented 9 months ago

Exactly in the same situation as @syl20cjs All visible but as soon as I try to switch on/off or change mode I've a timeout. The physical button works thus no issue with the cabling

baz-fr commented 9 months ago

Hello @syl20cjs , @carlofrancese Have you try with a simple MQTT command ( like MQTT Explorer ) ? I use this device with a Jeedom integration. Work perfectly.

carlofrancese commented 9 months ago

Hello @syl20cjs , @carlofrancese Have you try with a simple MQTT command ( like MQTT Explorer ) ? I use this device with a Jeedom integration. Work perfectly.

Hi @baz-fr after you mentioned MQTT Explorer i tried to publish messages as raw and json like "{ "mode": "comfort","state": "ON"}" (if it makes sense - i took inspiration from the read messages) but nothing changed. Also tried in RAW to send 1 or 0x01 - but still nothing

baz-fr commented 9 months ago

No need to set state, this is implicit. {"mode":"comfort"} change state to "on" (if you set "state" to "off" , this turn "mode" to "anti-freeze" ) I think you need to reset the device and retry the association. image

syl20cjs commented 9 months ago

On my side it started working without any action on my side After like 48h, but since then it works flawlessly

baz-fr commented 9 months ago

@carlofrancese have you the latest version? (correction about this device)

carlofrancese commented 8 months ago

Hi Everyone, don't know how but as for @syl20cjs it all started to work properly one day after without any rewiring or modification in configuration.

dinde commented 7 months ago

Hello, Exactly the same behaviour here. Adding + interview = OK Trying to control results a permanent fail I pressed the physical button on module and state is reported as below: "energy": 0.004, "last_seen": "2024-01-24T08:58:13.385Z", "linkquality": 102, "mode": "anti-freeze", "power": 515, "state": "ON", "pilot_wire_mode": "comfort" }

Logs reportes TimeOut on ping and any commands.

Tried to add / delete / force interview / pair with another router = all failed. Only a reset of the module got it to pair again but still without any control with mqtt Some people also reported that at some point it should start to work (outside this thread).

MichaelMure commented 5 months ago

Same here. I have three of those (same firmware). 2 work just fine, but the third has that timeout behavior.

It is plugged into a different brand of heater, but I don't see how that can affect anything.

MichaelMure commented 5 months ago

I believe I've found a big clue for that timeout issue: https://github.com/Koenkk/zigbee2mqtt/issues/22068

morcus commented 5 months ago

I found a solution for the timeout errors here: https://github.com/Koenkk/zigbee2mqtt/discussions/15683

You need to shut down zigbee2mqtt, edit database.db and modify the entry of the broken device from [242,1] to [1,242].