Yet another plugin with support for automatic device discovery for pimatic 0.9
-
New Plugin for Edimax SmartPlugs
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Hello,
first I want to thank for this nice plugin as I’ve ordered some of these smart plugs on the black week sales. Works like a charm.
Unfortunatelly, I’m missing one feature for my use cases.
One of these plugs automates a cat drinking well, for which I have set up a schedule.
This works very well, but my kids are activating the plug very often manually when a cat is sitting before the well making big eyes …I would like to get the information if the current on/off state is scheduled or not - or the other way round, I would like to know if it was activated manually to be able to switch it off after something like 10 minutes or so.
I tried to think of a rule, but there is no possibility to know if it was scheduled or not. The only way would be to set up the schedule within pimatic again …
Well, I would more like to use the schedule features of the plug itself and get this extra info … So, I had a look at the schedule string. It is quite clear how it is encoded, but at the moment I do not really know how to simply strip this down to “current time is within scheduled time” …
My schedule for sunday (‘0’) looks like this "‘0’: ‘60801-b0d01-g0iu1-k0m01-n5nO0’"
This decodes simply to:60801 = 06:00 - 08:00 - On b0d01 = 11:00 - 13:00 - On g0iu1 = 16:00 - 18:30 - On k0m01 = 20:00 - 22:00 - On
and as an Off/big number - Example
n5nO0 = 23:05 - 23:50 - Off
So the numbers 0 to 60 are encoded as something like 0-9a-zA-Z
And at the end there is a 0 or a 1 for Off / OnFor me it would really be sufficient to have a boolean attribute saying that I’m currently in a scheduled On time slot or not.
Maybe I will find time to contribute something, but some code snippet or other assistence would really help @mwittig @developer
Regards,
Markus
-
@Markus-Plessing If I understand this correctly, it would be good enough to decide whether the current switch state is in line with the “schedule” or it has been switched, manually. The “schedule” is something you have programmed using the Edimax App or similar, I guess. In this case it should be easy to implement as the base library already provides the method to read the switch schedule - https://www.npmjs.com/package/edimax-smartplug.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig Thanks for your hints.
I’ve set this up locally now and it seems to work. Have seen there is already an inlined decoding function for the history values.
This was useable also for decoding the schedule.
At the moment I’m using a device attribute. Is there something more useful and feasible only for rules? Don’t think this info should be displayed by default…
Will test a bit more and maybe fork tomorrow morning.
Regards.
-
@Markus-Plessing said in New Plugin for Edimax SmartPlugs:
Will test a bit more and maybe fork tomorrow morning.
Sounds great! Looking forward to your contribution!
Btw, it is unclear to me why you need to access history values. Wouldn’t it be sufficient to access the program schedule?
smartplug.getSchedule(options).then(function (schedule) { console.log(schedule); }).catch(function(e) {console.log("Request failed: ", e)});
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig You will see what I was talking about.
I reused only the inlined decoder of the history function as the schedule is decoded the same way.
Pull request is pending for your review -
How can i reset the sensor? Today Week etc…
-
@t1m0 said in New Plugin for Edimax SmartPlugs:
How can i reset the sensor? Today Week etc…
As far as I know the Edimax SmartPlug does not provide this feature other than unplugging the SmartPlug.
Please correct me if I am wrong."It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Hm. I have pulled out and pulled in the sensor. Nevertheless I have the old values… Can i reset the values with a shell command?
-
@t1m0 said in New Plugin for Edimax SmartPlugs:
Nevertheless I have the old values…
The old value are read on startup form the pimatic database. They should be replace with the current values read from the SmartPlug.
Can i reset the values with a shell command?
No. I am not aware of a method to soft-reset the counters of the SmartPlug. The Smartphone App does not provide this either.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
The old value are read on startup form the pimatic database. They should be replace with the current values read from the SmartPlug.
The old values are not overwritten
-
@t1m0 said in New Plugin for Edimax SmartPlugs:
The old values are not overwritten
Are you sure? How did you check? Do you get proper currentPower? If so, the other power metering values should also be updated properly. May be it is a display bug - try reload in your browser.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig
yes i´m sure i get values from kW and W but the other values stay the same (month day week)
They are not set to 0 when I remove the plug -
Hi guys,
I really like the edimax plugin for pimatic. I use it, to track the power consumption of my Golf GTE Plugin Hybrid car and i really works very nice. But I have a lot of errors in my log since I installed the plugin. Does anybody know the reason for this? I attached a picture of the error-log.
By the way, I have an other question, maybe it is possible to add this with the next update. It would be very usefull for me, to save the power consumption for the last three months. Maybe it’s possible to add some variables to save the values. It would be even nicer, if it would be sorted by months, so I can assign the values to the months.
For example:
edimax-Golf-GTE-january = 142,564kWh
edimax-Golf-GTE-february= 138,352kWh
.
.
.
edimax-Golf-GTE-december= 175,842kWhmany greetings: Jaschkopf
-
@Jaschkopf said in New Plugin for Edimax SmartPlugs:
But I have a lot of errors in my log since I installed the plugin.
OK, I’ll have look into this. At a first glance, it looks like the smartplug is sometimes not reachable. Can you please check the quality of the WiFi connection between the smart plug and your wifi router?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
I checked my fritzbox and the signal strength of the edimax is -79dBm. Is this enought? The Edimax is in the garage, there are two rooms (three walls) between the router an the edimax.
-
@Jaschkopf said in New Plugin for Edimax SmartPlugs:
-79dBm
That’s poor and the connection is likely to break intermittently. See aslo https://en.wikipedia.org/wiki/Received_signal_strength_indication
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Hey there, i have 2 questions.
- is the plug setting on a new week/month to 0 by itself?
- is it possible to grab the kwh value and calculate the cost with a price/kwh and show in a diagram.
And the last question is good, saving the values per month to generate a yearly diagram would be very nice.