Giter Site home page Giter Site logo

Comments (21)

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024 1

total consumption counters are not visible in Eve app

I’ve only written in Currentconsumption support... haven’t written in total consumption support.

something is accidentally broken with dimmable lamps (homebridge crashes when switching them on/off talking about "brightness not being defined". Reverting back to original domoticz_accessory.js fixed this

Dammit - I’ll have to drag @xTheRamon in on that - sorry Ramon - think I broke something in my manual merging!

This type WORKS correctly:

It’s just defaulting to a meter sensor which only shows the output from the Data: field in the JSON as the “Waterflow” subtype isn’t implicitly supported.

Different Type/SubType combinations have to be handled differently... for instance the first only presents the Data: field, whereas the second presents Counter & CounterToday which means needing their own service definitions. Units have to be stripped from the readings else you can’t use use the data for any automation rules.

I’m going to need MQTT output for the RFXMeter also if you can get it...? For most of my meters that output similarly to the RFXMeter, via MQTT domoticz ONLY sends current consumption. Never sends total consumption.

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

Just to clarify: this is a standard mysensors pulse watermeter, not something exotic, so adding it might be useful

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

Have added that particular type / subtype combination to the existing Watermeter service - Head to homebridge-edomoticz/lib...

sudo mv domoticz_accessory.js domoticz_accessory.bak 
sudo wget https://raw.githubusercontent.com/PatchworkBoy/homebridge-edomoticz/4f41b0719ccd30465fbf174808cfd99e69bae8a2/lib/domoticz_accessory.js

Test & let me know...!

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

[eDomoticz] Initializing platform accessory 'Water Cold'...
/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:1218
var wMeterDeviceService = new (this.name);
^

TypeError: this.name is not a function
at Object.eDomoticzAccessory.getServices (/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:1218:33)
at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:357:36)
at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:343:32)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:15:19
at callbackLater (/usr/local/lib/node_modules/homebridge-edomoticz/index.js:172:37)
at Object. (/usr/local/lib/node_modules/homebridge-edomoticz/index.js:201:17)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/request/request.js:198:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/request/request.js:1082:10)

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

I assume the line
"var wMeterDeviceService = new (this.name);" should look like
"var wMeterDeviceService = new eDomoticzServices.MeterDeviceService(this.name);"

I corrected this, and also changed "CurrentConsumption" charachteristic to "Total consumption"

The counter is now listed in Eve, but:

  • it has 0, instead of data (except for Water Flow, it works and reflects current consuption)
  • it has Kwh istead of m3 (is there a "m3" in Homekit btw?)

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

Ok, here what happens: when the counter changes in Domoticz, the correct value appears in Eve, but very briefly, than changes back to zero.
So it's not persistent.

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

OK - give it another try now - I added it to completely the wrong characteristic last time. It’s now been shifted into a different one...

sudo mv domoticz_accessory.js domoticz_accessory.bak 
sudo wget https://raw.githubusercontent.com/PatchworkBoy/homebridge-edomoticz/mqtt-integration/lib/domoticz_accessory.js

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

Thanks.
Good news: flow counters (current consumption) work FLAWLESSLY now
Bad news:

  • total consumption counters are not visible in Eve app
  • something is accidentally broken with dimmable lamps (homebridge crashes when switching them on/off talking about "brightness not being defined". Reverting back to original domoticz_accessory.js fixed this

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

This type WORKS correctly:

{
"ActTime" : 1474567596,
"ServerTime" : "2016-09-22 21:06:36",
"Sunrise" : "06:16",
"Sunset" : "18:27",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "0.00 l/min",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 9,
"HardwareName" : "My Pi",
"HardwareType" : "MySensors Gateway USB",
"HardwareTypeVal" : 41,
"HaveTimeout" : false,
"ID" : "00000501",
"Image" : "Moisture",
"LastUpdate" : "2016-09-22 21:02:44",
"Name" : "Расход (Холодная)",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Waterflow",
"Timers" : "false",
"Type" : "General",
"TypeImg" : "moisture",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "62"
}
],
"status" : "OK",
"title" : "Devices"
}

This DOESN'T:
{
"ActTime" : 1474567677,
"ServerTime" : "2016-09-22 21:07:57",
"Sunrise" : "06:16",
"Sunset" : "18:27",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Counter" : "224.000 m3",
"CounterToday" : "400 Liter",
"CustomImage" : 0,
"Data" : "224.000 m3",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 9,
"HardwareName" : "My Pi",
"HardwareType" : "MySensors Gateway USB",
"HardwareTypeVal" : 41,
"HaveTimeout" : false,
"ID" : "0501",
"LastUpdate" : "2016-09-22 19:57:32",
"Name" : "Счетчик (Холодная)",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "RFXMeter counter",
"SwitchTypeVal" : 2,
"Timers" : "false",
"Type" : "RFXMeter",
"TypeImg" : "counter",
"Unit" : 0,
"Used" : 1,
"ValueQuantity" : "",
"ValueUnits" : "",
"XOffset" : "0",
"YOffset" : "0",
"idx" : "66"
}
],
"status" : "OK",
"title" : "Devices"
}

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

I’m going to need MQTT output for the RFXMeter also if you can get it...? For most of my meters that output similarly to the RFXMeter, via MQTT domoticz ONLY sends current consumption. Never sends total consumption.

yes, I recall analyzing MQTT output and noticing it. One of many Domoticz oddities.
I'll look at it again and post RFXMeter MQTT output here

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

Here we go:

{
"Battery" : 255,
"RSSI" : 12,
"dtype" : "RFXMeter",
"id" : "1280",
"idx" : 67,
"name" : "--------------",
"nvalue" : 0,
"stype" : "RFXMeter counter",
"svalue1" : "150700",
"unit" : 0
}
so, the actual value (sans decimal point) is in svalue1. If needed, 1000 is the correct divider, so the value displayed in Domoticz is 150.7

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

Cool - ta... but which value - current flow rate, or total flow rate? It’s only sending one. At the moment I’m assuming that’s current flow rate??

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

OK - back up current installation, and pull the mqtt-integration branch again... I’ve now added implicit water flow handling for both sensor types above, hopefully with correct units also. The brightness side of things I’ll have to leave to Ramon as I don’t actually HAVE any dimmers to diagnose with, and he wrote all of the dimming support in the plugin.

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

Sorry if I made it not clear. I have 2 data types coming from the water meter: flow and total consumption.
Flow shows momentarily flow and with the latest commit is shown correctly in Eve. I haven't posted the JSON for it since it works but I can if needed.
Total consumption meter shows (you guess it!) total consumption since the time the counter was installed. The figure in svalue1 is the one I need and the one visible on the physical hardware.

There is the third parameter (dayly consumption) that Domoticz calculate itself. The node attached to the hardware counter doesn't send it. I know it for sure since I designed it :-)
And It seems not be available in mqtt output.

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

Yep - got all that... latest commit should cover it correctly, for both your RFXMeter > RFXMeter Counter Device (IDX 66 - reading the Counter and CounterToday fields via HTTP, updating the Counter field from svalue1 via MQTT in realtime), and your General > Waterflow device (IDX 62 - reading just the Data field, updating just the data field from svalue1 via MQTT in realtime).

What I was trying to establish is:
If you take the MQTT output for IDX66, and compare it to the JSON output for IDX66, which two fields match up. What does svalue1 from the MQTT correlate to in the JSON.

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:52
this.getCharacteristic(Characteristic.Name) ||
^

TypeError: this.getCharacteristic is not a function
at Service (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:52:12)
at new eDomoticzServices.WaterDeviceService (/usr/local/lib/node_modules/homebridge-edomoticz/lib/services.js:98:13)
at Object.eDomoticzAccessory.getServices (/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:1249:31)
at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:357:36)
at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:343:32)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:15:19
at Object. (/usr/local/lib/node_modules/homebridge-edomoticz/index.js:203:41)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/request/request.js:198:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

rolls eyes I forgot to add the new services to the inheritance patches. Repull index.js and should be fixed - sorry!

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:1250
WaterMeterService.getCharacteristic(eDomoticzServices.Waterflow).on('get', this.getStringValue.bind(this));
^

TypeError: Cannot read property 'on' of undefined
at Object.eDomoticzAccessory.getServices (/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:1250:71)
at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:357:36)
at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:343:32)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:15:19
at Object. (/usr/local/lib/node_modules/homebridge-edomoticz/index.js:206:41)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/request/request.js:198:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/request/request.js:1082:10)
at emitOne (events.js:82:20)

from homebridge-edomoticz.

dmikhalsky avatar dmikhalsky commented on May 29, 2024

If you take the MQTT output for IDX66, and compare it to the JSON output for IDX66, which two fields match up. What does svalue1 from the MQTT correlate to in the JSON.

MQTT svalue1 "224500" partially correlates to JSON "Data" : "224.500 m3" or "Counter" : "224.500 m3"
There is no 1:1 match. It looks like MQTT provides raw data, while JSON is more "formatted" or "as is in GUI"

from homebridge-edomoticz.

rswilem avatar rswilem commented on May 29, 2024

I've only just now read that you dragged me in on this one. Haha. Whoops. I won't fix anything with dimmers now though as it seems they're working perfectly now.

from homebridge-edomoticz.

PatchworkBoy avatar PatchworkBoy commented on May 29, 2024

Create a new issue if still exists in current version - originally raised under v1.x - we’re not on v2.x

from homebridge-edomoticz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.