empierre / MyDomoAtHome

MyDomoAtHome - REST interface for ImperoHome with Domoticz (ISS)

Home Page:http://domoticz.com/wiki/ImperiHome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch with Power usage for sonoff pow

frnandu opened this issue · comments

commented

Imperihome seems to have the widget of a switch with its current power consuption showing under.
I'm wondering if it would be possible to use 2 domoticz devices (one switch + 1 usage electric) to create ONE imperihome widget which allows to switch on/off and shows the current usage.
This is specially usefull for sonoff pow devices which have to be configures in 2 domoticz devices.
Thanks for any help on this subject

That device doesn't exist in Imperihome ISS API sadly ;-(

commented

from http://dev.evertygo.com/api/iss:
screen shot 2018-05-30 at 13 42 46
Isn't the Energy parameter (in watts) exactly for that?

my bad, I did forget that, the problem is on the other side (there is another discussion here) where we can't match both except under certain conditons where we already did it see #73

can you see if your match the criteria ?

commented

Don't match.
When using sonoff pow with tasmota it uses 2 idx devices to post the switch state and it's power usage, and both are dummy completely unrelated (except if you name them apropriately).
I'm thinking maybe a possibility would be to have a section on /etc/mydomoathome/config.json where one can group them by idx or names. One way or another I will do something to have the values (even if hardcoded in mdah.js), since I really don't want to have 2 dashboards screen (one for switches and another for power usages).
Would be better of course if you could include some way of grouping them manually for people that want to do that.
What do you think?

that could be a possibility yes

Yes this would work I reckon.
Personally what I'm doing is to use node-red as a "proxy" for MDAH and I edit the MDAH response grouping devices by name.

So basically if I have a LivingRoomLights device I search for a LivingRoomLightskWhMeter and if exists then "group" them if that makes sense. Works perfectly fine but ofc it's not for everyone.

One option would be to do this at MDAH itself so add a setting like "watt meter suffix" that would make MDAH try to group device_name and device_name_watt_meter_suffix as one