empierre / MyDomoAtHome

MyDomoAtHome - REST interface for ImperoHome with Domoticz (ISS)
http://domoticz.com/wiki/ImperiHome
GNU General Public License v3.0
31 stars 22 forks source link

grouping switch and energy #73

Closed empierre closed 8 years ago

empierre commented 8 years ago
     "HardwareID" : 42,
     "ID" : "00014175",
     "AddjMulti" : 1.0,
     "AddjMulti2" : 1.0,
     "ID" : "00014174",
     "ID" : "00014177",
jonferreira commented 8 years ago

anything I can do to help @empierre ?

empierre commented 8 years ago

just be patient ;-) thanks anyway !

jonferreira commented 8 years ago

sure :-) this is far from a priority though, more like a "because I can" kinda thing ;-)

empierre commented 8 years ago

@jonferreira it looks like the grouping is working only for hardare devices such as created by zwave.

can you confirm it ?

else I would have to do it based on name, which is weak... and prone to error

jonferreira commented 8 years ago

I've noticed that in IH under Switches I have Z-Wave devices and Virtual Devices as well, Selector and Switch Type - not sure if this is what you're after?

I'm using MDAH 1.0.9 though, i've noticed 0.1.17 was released yesterday but I can't update with apt-get so will need to do it by hand :-)

empierre commented 8 years ago

@jonferreira sorry for the mis-numbering, do a remove/install will correct this.

my question was on domoticz side on the result of /json.htm?type=devices&filter=all&used=true&order=ID

do you have the same ID for switches and their energy counterpart? here my zwave is not on domoticz so I can't see a rule to group them except by name

jonferreira commented 8 years ago

ah yes, makes sense now :-)

This is what a single Qubino dimmer looks like in Domoticz - http://pastebin.com/6mjvviLS ID changes between devices which doesn't seem to make much sense if you ask me. There seems to be some sort of relationship between them but won't be easy to find a proper logic behind it.

You could remove all leading zeros and get only the first digit (7) but then we'd have a problem distinguishing between 7, 70, 700 and so on

empierre commented 8 years ago

hello, pastebin blocked there. can you post me the IDs with type/subtypes lpease ?

jonferreira commented 8 years ago

strange, it's a Public paste...

{
         "ID" : "00000701",
         "SubType" : "Switch",
         "SwitchType" : "Dimmer",
         "SwitchTypeVal" : 7,
         "Type" : "Light/Switch",
         "idx" : "120"
      },
      {
         "ID" : "00000700",
         "SubType" : "Switch",
         "SwitchType" : "On/Off",
         "SwitchTypeVal" : 0,
         "Type" : "Light/Switch",
         "idx" : "121"
      },
      {
         "ID" : "00000733",
         "SubType" : "Switch",
         "SwitchType" : "On/Off",
         "SwitchTypeVal" : 0,
         "Type" : "Light/Switch",
         "idx" : "122"
      },
      {
         "ID" : "00000732",
         "SubType" : "Switch",
         "SwitchType" : "On/Off",
         "SwitchTypeVal" : 0,
         "Type" : "Light/Switch",
         "idx" : "123"
      },
      {
         "ID" : "00000702",
         "SubType" : "Switch",
         "SwitchType" : "On/Off",
         "SwitchTypeVal" : 0,
         "Type" : "Light/Switch",
         "idx" : "124"
      },
      {
         "ID" : "00000736",
         "SubType" : "Switch",
         "SwitchType" : "On/Off",
         "SwitchTypeVal" : 0,
         "Type" : "Light/Switch",
         "idx" : "125"
      },
      {
         "ID" : "0000701",
         "SubType" : "Electric",
         "Type" : "Usage",
         "Type" : "Usage",
         "idx" : "126"
      },
      {
         "ID" : "0000007",
         "SubType" : "Electric",
         "Type" : "Usage",
         "idx" : "127"
      }
empierre commented 8 years ago

from what I read there: 0000701 is both dimmer and energy (same ID)

that is a single Qubino ?

jonferreira commented 8 years ago

yes this is a single Qubino, however ID is not exactly the same, it has one less zero: 00000701 vs 0000701 other examples would be:

Fibaro Wall Plug - 00001A01 vs 0001A01 Fibaro Roller Shutter - 00001901 vs 0001901

So far I've been unable to figure out the logic on a Fibaro Original Dimmer though

empierre commented 8 years ago

on vera this is simple: there is the master node and the "childrens" so I would guess 1A and 10 to be the master and afterward the childrens. Extra 0 is not an issue for me, I search more of a pattern between a switch and its energy countepart

jonferreira commented 8 years ago

yes deffo, extra zero is not a problem. TBH I find energy Metering extremely confused in Domoticz and still haven't quite figured it out yet...for instance we have a Electric and KWh Subtype, electric seems to give the current power consumption while KWh will retrieve historical data...well if that's the case then we'll need to merge all three together in IH to have access to graphics... Plus it's extremely difficult to identify the devices since ID isn't the same across all "childs"...

empierre commented 8 years ago

sure, when you have that, do the three have the same name ?

jonferreira commented 8 years ago

not unless you set it, default name for kWh is "kWh Meter" and "Power Meter"/"Unknown" for Electric SubType...

I just now realized there might be some logic here though...

Switch and kWh ID's are always the same (00000701) and Electric has one less zero (0000701)

empierre commented 8 years ago

great !

I was wondering what a 6 plug nuon would look like for it has 6 plugs with energy, plus one for itself with total energy

jonferreira commented 8 years ago

can't tell as I don't have one :(...I'll see if I can include a Qubino Dual Channel Relay and see how it looks like

empierre commented 8 years ago

I have two but not on domoticz and I don't have a zwave key anymore to test

jonferreira commented 8 years ago

no problem I can probably do it this afternoon

jonferreira commented 8 years ago

looks like it follows the same logic we've discussed above so it should be fine :-)

empierre commented 8 years ago

good news, will have a look how to make it btthe bad news is that I can't reproduce it locallycould you share me your domoticz.db without email params in it?

jonferreira commented 8 years ago

sure not a problem, just need to take a look at where/how to remove any private passwords etc... any chance i can email you directly?

empierre commented 8 years ago

yes domoticz@e-nef.com

th change it the best would be to duplicate the domoticz, stop the master, start the clone and change domoticz.db params, stop it and restart the master (not sure I'm clear enough here)

empierre commented 8 years ago

@jonferreira can you put me in list the following for above devices ? thanks id type subtype

jonferreira commented 8 years ago

mailed you a xls with full details. hope it helps

empierre commented 8 years ago

on devswitch I can only put one value which I gess is the immediate usage. The last device should be left alone to have the historical value I guess. Which of the 2 is the instant value ?

jonferreira commented 8 years ago

as far as I can see Instant usage is on the "Energy" device, historical data on the "kWh" device

empierre commented 8 years ago

ok so the switch is to be grouped with the one with a less 0 to have instant. For the graph, I should leave together the second device with the less 0 eventually.

jonferreira commented 8 years ago

yeah sounds about right

empierre commented 8 years ago

good feebacks so far, closing now

thanks @jonferreira