robertklep / name.klep.sonoff

Homey driver for Sonoff devices
7 stars 7 forks source link

Feature request to support TH16/Pow Tasmota model #6

Open Asinke opened 6 years ago

Asinke commented 6 years ago

Hi Robert, Ould it be possible to support Sonoff TH16 and Pow modules with Tassmota firmware in addition to already excellent support?

Documentation the the MQTT/JSON responses can be found here: https://github.com/arendst/Sonoff-Tasmota/wiki/JSON-Status-Responses#am2301. (The TH16 model uses the AM2301 temp/humidity sensor)

Of course i'm willing to beta test the additional code, I did some local install in the past but i'm no programmer fo sure :-)

Here is part of the TH16 console log showing the MQTT responses: 00:00:09 DNS: Initialized 00:00:09 HTP: Web server active on TH16.local with IP address 192.168.0.99 18:24:54 MQT: Attempting connection... 18:24:54 MQT: Connected 18:24:54 MQT: tele/TH16/LWT = Online (retained) 18:24:54 MQT: cmnd/TH16/POWER = 18:24:54 MQT: tele/TH16/INFO1 = {"Module":"Sonoff TH","Version":"5.12.0","FallbackTopic":"TH16-1","GroupTopic":"sonoffs"} 18:24:54 MQT: tele/TH16/INFO2 = {"WebServerMode":"Admin","Hostname":"TH16","IPAddress":"192.168.0.99"} 18:24:54 MQT: tele/TH16/INFO3 = {"RestartReason":"Software/System restart"} 18:24:54 MQT: homeassistant/switch/TH16/config = (retained) 18:24:55 MQT: stat/TH16/RESULT = {"POWER":"OFF"} 18:24:55 MQT: stat/TH16/POWER = OFF 18:25:03 MQT: tele/TH16/STATE = {"Time":"2018-03-02T18:25:02","Uptime":"0T00:00:19","Vcc":3.151,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":66,"APMac":"60:A4:4C:DC:F8:78"}} 18:25:03 MQT: tele/TH16/SENSOR = {"Time":"2018-03-02T18:25:03","AM2301":{"Temperature":22.6,"Humidity":32.4},"TempUnit":"C"}

robertklep commented 6 years ago

Thanks for posting this data :)

Does the sensor data get posted periodically, or do you have to query the device for it?

Asinke commented 6 years ago

The sensor roughly posts an update every 5 minutes or so using the tele topic. See below for a continuation of the console log

18:24:54 MQT: homeassistant/switch/TH16/config = (retained) 18:24:55 MQT: stat/TH16/RESULT = {"POWER":"OFF"} 18:24:55 MQT: stat/TH16/POWER = OFF 18:25:03 MQT: tele/TH16/STATE = {"Time":"2018-03-02T18:25:02","Uptime":"0T00:00:19","Vcc":3.151,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":66,"APMac":"60:A4:4C:DC:F8:78"}} 18:25:03 MQT: tele/TH16/SENSOR = {"Time":"2018-03-02T18:25:03","AM2301":{"Temperature":22.6,"Humidity":32.4},"TempUnit":"C"} 18:30:10 MQT: tele/TH16/STATE = {"Time":"2018-03-02T18:30:10","Uptime":"0T00:05:19","Vcc":3.160,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":60,"APMac":"60:A4:4C:DC:F8:78"}} 18:30:10 MQT: tele/TH16/SENSOR = {"Time":"2018-03-02T18:30:10","AM2301":{"Temperature":22.6,"Humidity":32.4},"TempUnit":"C"}

On 2 Mar 2018, at 18:31, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

Thanks for posting this data :)

Does the sensor data get posted periodically, or do you have to query the device for it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-369992468, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVHfNPCmQazB0mneVDR9H3oxO8u6_ks5taYHogaJpZM4SaO05.

chinswain commented 6 years ago

I have both of these devices sitting unused so can test if needed (Have DS18B20 sensor for the TH16)

robertklep commented 6 years ago

In terms of support for these devices, I was thinking about:

Anything else?

Asinke commented 6 years ago

I would already be thrilled with this support.

If its not too much trouble, I would also like to see support for the SHT3X and PMS5003 sensors to be also included. Note: The PMS supports 3 different PM sizes, homey only supports just one (PM2.5 if I remember correctly)

On 2 Mar 2018, at 20:34, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

In terms of support for these devices, I was thinking about:

Anything else?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-370028823, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVLSpKDP-uSR_TyVQQK_wXBpkmMRYks5taZ6qgaJpZM4SaO05.

robertklep commented 6 years ago

@Asinke can you send an MQTT command to your TH16 device and see what it sends in response?

The topic to send to is cmnd/TH16/gpio, payload can be an empty string. It should respond on stat/TH16/RESULT.

Preferably for all the sensors that you have.

Asinke commented 6 years ago

Hi Robert,

This the response I get:

19:04:18 MQT: stat/TH16/RESULT = {"GPIO1":"0 (None)","GPIO3":"0 (None)","GPIO4":"0 (None)","GPIO14":"2 (AM2301)”}

On 5 Mar 2018, at 13:10, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

cmnd/TH16/gpio

robertklep commented 6 years ago

Thanks :) If you can do the same for any other sensors you have? The more info I have, the easier it will be to implement.

robertklep commented 6 years ago

If you can do the same for any other sensors you have? The more info I have, the easier it will be to implement.

I'm especially interested in the SHT3X sensor, because that's one that isn't mentioned in the list for the gpios command (cmnd/sonoff-rf-bridge/gpios).

Asinke commented 6 years ago

Hi Robert,

I don’t have a sensor configured with the SHT3X or PMS5002 sensors at the moment.

I see what you mean about the SHT3X sensor, you can’t select it from the module’s GPIO menu. The DHT11, DHT12 and SHT3X sensors however are all pin compatible with different tolerances for accuracy.

Before the weekend, I don’t have the time available to assemble, configure and test a Tasmota/Sonoff module with these sensors.

Configuring a DH11 sensor (without actually being connected) yields following output. Of course the readings are invalid, but I guess its the response you’re looking for?

19:07:20 MQT: tele/TH16/SENSOR = {"Time":"2018-03-06T19:07:20","DHT11":{"Temperature":0.0,"Humidity":1.0},"TempUnit":"C"}

On 6 Mar 2018, at 16:21, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

If you can do the same for any other sensors you have? The more info I have, the easier it will be to implement.

I'm especially interested in the SHT3X sensor, because that's one that isn't mentioned in the list for the gpios command (cmnd/sonoff-rf-bridge/gpios).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-370816219, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVPWWwf06wKyGlUXGx9pDC29c7kykks5tbqlqgaJpZM4SaO05.

robertklep commented 6 years ago

No worries :)

I'm mostly interested in the result of cmnd/TH16/gpio with an SHT3X attached, because that's the endpoint I'm using to detect which sensors are attached to a device during pairing and where I add the correct Homey capabilities to the device (measure_temperature, measure_humidity, etc).

A bit of background: the capabilities a device can support on Homey can't be changed after the device has been created. So during the pairing phase, I have to query the device (using the aforementioned MQTT topic) to check which sensors it has attached, and I maintain a list of sensor names ("DHT11", "AM2301", ...) and the capabilities they provide.

For now, I'll assume that the sensor name will be "SHT3X" and that it will provide both temperature and humidity values.

Asinke commented 6 years ago

If time permits, i will heat up my soldering iron in the weekend and connect a SHT3X sensor which i can use afterwards for testing your updated app as well! Looking at the Tasmota documentation i think its safe for now to assume the sensor name will indeed be SHT3X

On 6 Mar 2018, at 19:38, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

No worries :)

I'm mostly interested in the result of cmnd/TH16/gpio with an SHT3X attached, because that's the endpoint I'm using to detect which sensors are attached to a device during pairing and where I add the correct Homey capabilities to the device (measure_temperature, measure_humidity, etc).

A bit of background: the capabilities a device can support on Homey can't be changed after the device has been created. So during the pairing phase, I have to query the device (using the aforementioned MQTT topic) to check which sensors it has attached, and I maintain a list of sensor names ("DHT11", "AM2301", ...) and the capabilities they provide.

For now, I'll assume that the sensor name will be "SHT3X" and that it will provide both temperature and humidity values.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-370883566, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVCn370M6O6DI4jubGuSJ-UONki-Sks5tbte5gaJpZM4SaO05.

robertklep commented 6 years ago

I ordered a POW and a TH10, I'd rather test the devices myself before I release a new version of the app that doesn't work properly.

Out of interest: are you running v3.0.0 (the current beta) of the app? I'm interested in hearing if it works, because it was a pretty big release in terms of changed (I rewrote the part that deals with the MQTT server).

Asinke commented 6 years ago

Hi Robert,

Did you order them from China, in that case it may take a while depending on the chosen vendor!

I’m running the latest stable release. will look into V3.0 beta soon.

BTW. I’m willing to beta test your updated App before you release it.

Arthur

On 18 Mar 2018, at 15:01, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

I ordered a POW and a TH10, I'd rather test the devices myself before I release a new version of the app that doesn't work properly.

Out of interest: are you running v3.0.0 (the current beta) of the app? I'm interested in hearing if it works, because it was a pretty big release in terms of changed (I rewrote the part that deals with the MQTT server).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-374001559, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVAExw4J4NWYdVvOp2rr1oPzp_EoLks5tfmjKgaJpZM4SaO05.

robertklep commented 6 years ago

Did you order them from China, in that case it may take a while depending on the chosen vendor!

I did, and I know :) Typically it takes a week or two.

I’m running the latest stable release. will look into V3.0 beta soon. BTW. I’m willing to beta test your updated App before you release it.

I'll see if I can wrap up the sensor code so you can test, although it would require some experience with Github and side-loading Homey apps (but I'll explain).

chinswain commented 6 years ago

As a real work usage case, I'm wanting to monitor a water pump that comes on for 30 seconds 4 times a day. If it's on for more than 60 seconds I want to turn off the relay - do you think that would be possible via Homey?

robertklep commented 6 years ago

As a real work usage case, I'm wanting to monitor a water pump that comes on for 30 seconds 4 times a day. If it's on for more than 60 seconds I want to turn off the relay - do you think that would be possible via Homey?

It would obviously require a solution where the controlling mechanism for the pump notifies Homey when the pump is turned on and off, but if that's possible, one option would be to start a countdown timer (using the Countdown app) for 60 seconds, and add two triggers: for when the pump is turned off (in which case the countdown timer is cancelled), and for when the countdown timer has triggered (in which case the relay should be turned off).

robertklep commented 6 years ago

The TH10 and TH16 devices are supported as of v4.0.0, which I just submitted for approval as a beta release. May take a few days for Athom to publish it.

For now, only sensors that support temperature and/or humidity are supported.

Asinke commented 6 years ago

Hi Robert,

Great, looking forward to testing this new version.

Arthur

On 3 Apr 2018, at 14:52, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

The TH10 and TH16 devices are supported as of v4.0.0, which I just submitted for approval as a beta release. May take a few days for Athom to publish it.

For now, only sensors that support temperature and/or humidity are supported.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-378238868, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVGXL9aNLxye-_RyNUdicp-97YGHgks5tk3B_gaJpZM4SaO05.

robertklep commented 6 years ago

Version 4.0.1 (beta) was just published to the Homey app store.

robertklep commented 5 years ago

@Asinke have you had a chance to test with different sensors attached?

Asinke commented 5 years ago

@Robert Oeps I missed out on your last message during my holidays. Now winter is coming I started my first project again. This time a sonoff basic with Tasmota and 6 DS18B20 temperature sensors. I noticed these are not yet supported by the app. Would it be possible to add this sensor to the driver? I can supply whatever information you need. Below you'll find an extract from the MQTT broker log:

20181103-14:27:58 Packet published {"Time":"2018-11-03T14:27:46","Uptime":"20T05:14:47","Vcc":3.160,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":58,"APMac":"B0:4E:26:24:B2:C7"}} 20181103-14:27:58 getLogLines called 20181103-14:27:58 Packet published {"Time":"2018-11-03T14:27:51","AM2301":{"Temperature":nan,"Humidity":nan},"TempUnit":"C"} 20181103-14:28:21 getLogLines called 20181103-14:30:00 Packet published {"Time":"2018-11-03T14:29:53","Uptime":"56T19:21:55","Vcc":3.231,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":40,"APMac":"50:C7:BF:78:6E:1E"}} 20181103-14:30:31 Packet published {"Time":"2018-11-03T14:30:31","Uptime":"49T09:41:50","Vcc":3.162,"POWER":"ON","Wifi":{"AP":1,"SSId":"TGV","RSSI":50,"APMac":"50:C7:BF:78:6E:1E"}} 20181103-14:30:31 Packet published {"Time":"2018-11-03T14:30:31","ENERGY":{"Total":24.712,"Yesterday":0.095,"Today":0.084,"Period":0,"Power":0,"Factor":0.00,"Voltage":233,"Current":0.000}} 20181103-14:32:04 Packet published {"Time":"2018-11-03T14:32:03","Uptime":"0T00:05:14","Vcc":3.410,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":58,"APMac":"B0:4E:26:24:B2:C7"}} 20181103-14:32:04 Packet published {"Time":"2018-11-03T14:32:03","DS18B20-1":{"Id":"02029177302D","Temperature":20.7},"DS18B20-2":{"Id":"021391771071","Temperature":20.6},"DS18B20-3":{"Id":"0219917770C4","Temperature":20.1},"DS18B20-4":{"Id":"021991779F8A","Temperature":20.8},"DS18B20-5":{"Id":"031760055EFF","Temperature":21.3},"DS18B20-6":{"Id":"0417A0ADACFF","Temperature":20.9},"TempUnit":"C"} 20181103-14:32:28 Packet published {"Time":"2018-11-03T14:32:28","Uptime":"129T08:10:38","Vcc":3.180,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":46,"APMac":"B0:4E:26:24:B2:C7"}} 20181103-14:33:21 Packet published {"Time":"2018-11-03T14:33:11","Uptime":"20T05:20:12","Vcc":3.152,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":58,"APMac":"B0:4E:26:24:B2:C7"}} 20181103-14:33:23 Packet published {"Time":"2018-11-03T14:33:15","AM2301":{"Temperature":nan,"Humidity":nan},"TempUnit":"C"} 20181103-14:33:42 Packet published {"Time":"2018-11-03T14:33:42","ENERGY":{"Total":24.712,"Yesterday":0.095,"Today":0.084,"Power":1,"Factor":0.13,"Voltage":233,"Current":0.048}} 20181103-14:33:52 Packet published {"Time":"2018-11-03T14:33:52","ENERGY":{"Total":24.712,"Yesterday":0.095,"Today":0.084,"Power":0,"Factor":0.00,"Voltage":233,"Current":0.074}} 20181103-14:35:10 Packet published {"Time":"2018-11-03T14:35:06","Uptime":"56T19:27:08","Vcc":3.230,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":40,"APMac":"50:C7:BF:78:6E:1E"}} 20181103-14:35:45 Packet published {"Time":"2018-11-03T14:35:45","Uptime":"49T09:47:04","Vcc":3.161,"POWER":"ON","Wifi":{"AP":1,"SSId":"TGV","RSSI":52,"APMac":"50:C7:BF:78:6E:1E"}} 20181103-14:35:45 Packet published {"Time":"2018-11-03T14:35:45","ENERGY":{"Total":24.712,"Yesterday":0.095,"Today":0.084,"Period":0,"Power":0,"Factor":0.00,"Voltage":233,"Current":0.000}} 20181103-14:37:04 Packet published {"Time":"2018-11-03T14:37:03","Uptime":"0T00:10:14","Vcc":3.410,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":60,"APMac":"B0:4E:26:24:B2:C7"}} 20181103-14:37:04 Packet published {"Time":"2018-11-03T14:37:03","DS18B20-1":{"Id":"02029177302D","Temperature":20.5},"DS18B20-2":{"Id":"021391771071","Temperature":20.5},"DS18B20-3":{"Id":"0219917770C4","Temperature":20.3},"DS18B20-4":{"Id":"021991779F8A","Temperature":20.7},"DS18B20-5":{"Id":"031760055EFF","Temperature":21.2},"DS18B20-6":{"Id":"0417A0ADACFF","Temperature":20.9},"TempUnit":"C"} 20181103-14:37:37 Packet published {"Time":"2018-11-03T14:37:36","Uptime":"129T08:15:38","Vcc":3.179,"POWER":"OFF","Wifi":{"AP":1,"SSId":"TGV","RSSI":46,"APMac":"B0:4E:26:24:B2:C7"}}

robertklep commented 5 years ago

@Asinke thanks for the data, useful to see how data for multiple sensors is being transmitted.

I'm working on a "generic" device driver for devices like this, where the driver will try and sniff out the capabilities of a device on its own, instead of assuming a fixed set of capabilities like the other drivers do.

Will hopefully push a beta with that driver within the next two weeks or so.

Asinke commented 5 years ago

Hi Robert,

Sounds awesome, with limited time available i’m always willing to test.

BTW. I wired this project to my underfloor heating system. Provides really good insights into how to best tune this system.

On 3 Nov 2018, at 14:50, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

@Asinkehttps://github.com/Asinke thanks for the data, useful to see how data for multiple sensors is being transmitted.

I'm working on a "generic" device driver for devices like this, where the driver will try and sniff out the capabilities of a device on its own, instead of assuming a fixed set of capabilities like the other drivers do.

Will hopefully push a beta with that driver within the next two weeks or so.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-435589433, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVMrMOsxBsX391CDjpsRk7PMv67Bwks5urZ8ygaJpZM4SaO05.

Tabe1 commented 5 years ago

Hello I have been trying this app from app store. I dont get the temp/humidity sensor to work with my th16. It was easy go add and i am running The original firmware. Any ideas?

robertklep commented 5 years ago

@tabe1 the driver for the original firmware doesn't support any sensors, it only supports the on/off capability of the device. For sensor support, the Tasmota firmware is required.

robertklep commented 5 years ago

@asinke could you do me a favor and send an MQTT command to that Basic with 6 sensors?

Topic: cmnd/XXX/status (where "XXX" is the configured Tasmota name of the device) Value: 10

It should respond with a message that contains the sensor configuration.

Asinke commented 5 years ago

Got this from the console, looks truncated though

5:21:10 CMD: cmnd/sonoff2/status 10 15:21:10 MQT: stat/sonoff2/STATUS10 = {"StatusSNS":{"Time":"2018-11-09T15:21:10","DS18B20-1":{"Id":"02029177302D","Temperature":24.7},"DS18B20-2":{"Id":"021391771071","Temperature":23.6},"DS18B20-3":{"Id":"0219917770C4","Temperature":23.0},"DS18B20-4":{"Id":"021991779F8A","Temperature":23.8},"DS18B20-5":{"Id":"031760055EFF","Temperature":25.4},"DS18B20-6":{"Id":"0417A0ADACFF","Temperature":23.8},"Temp ...

Looking at the MQTT broker log, i get this: 20181109-15:21:10 Packet published {"StatusSNS":{"Time":"2018-11-09T15:21:10","DS18B20-1":{"Id":"02029177302D","Temperature":24.7},"DS18B20-2":{"Id":"021391771071","Temperature":23.6},"DS18B20-3":{"Id":"0219917770C4","Temperature":23.0},"DS18B20-4":{"Id":"021991779F8A","Temperature":23.8},"DS18B20-5":{"Id":"031760055EFF","Temperature":25.4},"DS18B20-6":{"Id":"0417A0ADACFF","Temperature":23.8},"TempUnit":"C"}}

On 9 Nov 2018, at 15:03, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

cmnd/XXX/status

robertklep commented 5 years ago

Thanks, very useful!

robertklep commented 5 years ago

@asinke and another request, this time for cmnd/XXX/gpio (with an empty value)

Asinke commented 5 years ago

17:40:44 CMD: cmnd/sonoff2/gpio 17:40:44 MQT: stat/sonoff2/RESULT = {"GPIO1":"0 (None)","GPIO3":"0 (None)","GPIO4":"0 (None)","GPIO14":"4 (DS18x20)"}

On 11 Nov 2018, at 14:56, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

cmnd/XXX/gpio

robertklep commented 5 years ago

So you have 6 DS18B20's connected to GPIO14? Didn't even know that was possible 😅

Asinke commented 5 years ago

Wonderful world of 1Wire :-). I have 2 more on order. You need to build your own bin from tasiota source with Below setting enabled

define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)

On 11 Nov 2018, at 20:39, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

So you have 6 DS18B20's connected to GPIO14? Didn't even know that was possible 😅

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-437698185, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVG0WS5mvfZz6lzt6GaHExAYK1wstks5uuH0FgaJpZM4SaO05.

robertklep commented 5 years ago

Oh now I understand what the Id properties are for ;) I guess that the sensors send their Id as part of the updates, that's how Tasmota can tell them apart. So even if the sensors have the same I2C address, it will still work.

robertklep commented 5 years ago

Little update: this might be more difficult than I anticipated.

The problem is that I want to be able to create a "generic" Tasmota driver that will automatically determine which capabilities a Sonoff device has.

I have a version of such a driver that works, provided that there is no overlap in capabilities between sensors, meaning that if a device has two temperature sensors attached to it, the Homey device will have only one measure_temperature capability, and updates from any of the sensors will update the capability value.

Now that I realise that it's perfectly possible to have capability overlap (6 temperature sensors on one device 😅), I have to consider going down an entirely different path: create a measure_temperature capability for every sensor. That's something that Homey supports, but the additional difficulty is that I need to keep track which sensor is responsible for which capability.

So I additionally need to store some sort of lookup table in the pairing information that gets consulted whenever a sensor updates its value.

In other words, it may take more time than I hoped.

Asinke commented 5 years ago

Thanks for the update. I do understand the complexity and the extra effort required. Hopefully you’ll find this project challenging enough to continue development on.

On 12 Nov 2018, at 14:15, Robert Klep notifications@github.com<mailto:notifications@github.com> wrote:

Little update: this might be more difficult than I anticipated.

The problem is that I want to be able to create a "generic" Tasmota driver that will automatically determine which capabilities a Sonoff device has.

I have a version of such a driver that works, provided that there is no overlap in capabilities between sensors, meaning that if a device has two temperature sensors attached to it, the Homey device will have only one measure_temperature capability, and updates from any of the sensors will update the capability value.

Now that I realise that it's perfectly possible to have capability overlap (6 temperature sensors on one device 😅), I have to consider going down an entirely different path: create a measure_temperature capability for every sensor. That's something that Homey supports, but the additional difficulty is that I need to keep track which sensor is responsible for which capability.

So I additionally need to store some sort of lookup table in the pairing information that gets consulted whenever a sensor updates its value.

In other words, it may take more time than I hoped.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertklep/name.klep.sonoff/issues/6#issuecomment-437875432, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeicVDuE629GSWb3bx8SVTF5PNRaJ9Jnks5uuXRUgaJpZM4SaO05.