Good idea. I am using a different washing machine icon and it doesn’t exist in different version. So this doesn’t really matter to me. I would like that feature of course.
Something I would need to test: Does @rlkoshak’s solution not work with the following?
washingmachine_off.svg
washingmachine_finished.svg
…
Btw. I just realized, that my mapping file is not part of the first posting. Nobody said something, I should add it to make the tutorial complete.
It did for me as of a month or so ago. I’ve not rebuilt my sitemap yet to know if something is broken (and I might go with Habpanel this time…
The usual caveats apply:
must have a default icon
the state part of the icon name must be all lower case
the icon selected is what the state gets mapped to in the label, not the Item’s raw state (this is a change from how it worked in OH 1, I haven’t decided yet whether I just dislike that or really hate it, I just don’t find it intuitive)
I hate it and actually think the change is a design flaw. If you use a mapping to localize labels (like Dutch in my case) this would force me to create custom icons, or, actually for any other language. This is too much to ask from the mass. Changing label mappings (or having multi language sitemaps for one single items file) would imply having multiple icon sets. A no-go for me.
I did some additional testing. It looks like classic UI does use the “unmapped” value (like OH1), basic UI does too (but doesn’t auto-refresh) but the iOS app NOT use the unmapped value.
It doesn’t matter if the icon is remapped in the sitemap.
test.items
Group Test
Switch Test1 "Schakelaar 1 [MAP(nl.map):%s]" <switch> (Test)
Switch Test2 "Schakelaar 2 [%s]" <switch> (Test)
test.sitemap
sitemap test label="Test" {
Frame label="Schakelaars" {
Switch item=Test1
Text item=Test1
Text item=Test1 label="Schakelaar 1 [%s]" icon="switch"
Switch item=Test2
Text item=Test2
Text item=Test2 label="Schakelaar 2 [MAP(nl.map):%s]" icon="switch"
Group item=Test
}
}
My Sonoff Pow (or my Washing Machine, or my Dryer?) detects some peaks, even if the program is finished. Partly because they machine perfome some “anti-crease” actions to prevent the laundry to get knitted. partly because of some internal measuring effects of the Pow.
So I came up with an different approach for detecting the machine states: If you’re using persistance, why not use historic data for this. So I use the item.averageSince(AbstractInstant) extension to get an average of the last minutes to check, if there’s just noise or if it’s really a change of state:
so my rule ended up like this:
val Number MODE_OFF = 0
val Number MODE_STANDBY = 1
val Number MODE_ACTIVE = 2
val Number MODE_FINISHED = 3
rule "Washingmachine Consumption State Machine"
when
Item Washingmachine_Power changed
then
if (Washingmachine_Power.averageSince(now.minusMinutes(2)) < 0.2) Washingmachine_OpState.postUpdate(MODE_OFF)
else if (Washingmachine_Power.averageSince(now.minusMinutes(2))> 10) Washingmachine_OpState.postUpdate(MODE_ACTIVE)
else if (Washingmachine_Power.averageSince(now.minusMinutes(2))< 5) {
if (Washingmachine_OpState.state == MODE_OFF) Washingmachine_OpState.postUpdate(MODE_STANDBY)
else if (Washingmachine_OpState.state == MODE_ACTIVE) Washingmachine_OpState.postUpdate(MODE_FINISHED)
}
end
In that case, adding a item “Washingmachine_full” would be ON the same time, Washingmachine_OpState goes over to “MODE_FINISHED”. So you can add a rule, if the state of Washingmachine_full is ON since 30mins or so, you get some more decisive action like some creepy sound playing in the house, or whatever you like. That’s our pain even getting some pushovers to your mobile when the machine is ready: you press OK and it’s easily forgotten.
Hey Thomas, averageSince is a nice idea! I had my personal reasons to not relying on persistence here but I can totally see the benefit, even for my system now. I’ll add the solution to the first post.
I’ll add the button idea as well. I myself just use the machine for it by only turning it off after I’ve removed everything. You know how it is, “Tausend Wege führen nach Rom”
I’ve no time right now, please remind me if I forget Thanks!
I hope to try some of this this weekend. But curious how effective identifying your power consumption state on smaller appliances like toasters is. Or if there are multiple appliances going at the same time, if OH2 is getting confused on reporting the correct state of each.
I’m also considering getting an Aeotec HEM. Would monitoring the power consumption there give a better measurement?
Basically, I’m pretty sure, you’re not getting a clear picture, if there’s are more than one device on one measurment device. There’s too much noise to be considered and the logic would be a total mess. I didn’t expect much from my 10€ China-device, but it seems pretty stable. If you have a dedicated measuring device of any kind, you have to find out two things:
how is the power consumption regarding to what you would like to achieve
how short your intervals schould be. I can imagine a toaster requires a much shorter interval than a washing machine.
If you have done this (like @ThomDietrich explained in the first post of this thread), you can then adjust your rule to that.
Long Story short: I don’t think there’s a device small enough to be monitored and it is nearly impossible to filter a specific device, if you connect more than one to your power measurement device.
as explained above, the 10€ China-device delivers enough output for a clear rule. I don’t know the Aeotec HEM, but it should do the job. All you need is a reading of the wattage over time and then compare it to your thresholds - that’s it.
I do have some headaches also regarding the amount of data, which goes into the MySQL Server at this point. But I’m thinking of a garbage collection within MySQL or in a monthly/weekly rule within OH2 to get the old data out of the persistance. There are some values, which I want to persist over years (e.g. some variables regarding heating, weather and so on), to have a base for future rules or comparisons - but I don’t think the persisted Washing Machine states will needed for this!
@ptmuldoon I agree, it would be a fun experiment to break down overall consumption of multiple devices but from a practical standpoint, just get two modules and be done with it
Regarding the toaster: First it’s not a problem to detect states as long as they are characterized by a certain wattage (and/or duration). @binderth is right that it could be problematic to observe the toaster, as he will be active only for a short time. However you (@binderth) forgot, that most modules have a threshold option They will send acyclic extra measurements if a certain value is passed.
Both the mentioned Homematic and Sonoff Pow module provide this functionality.
I’d also recommend the Sonoff Pow as a cheap good module:
Ok, but I’m really not sure how I connect those cheap modules to a washing machine or other without needing splice the power plug to the device, etc. Unless I am misreading the instructions to use them.
Aeotec offers the more expensive zwave home energy meter. And I was thinking perhaps monitoring the usage there of each device and you could do the same thing?
I have one of those hooked up to the main feed circuit in the fuse box, so basically monitoring the total energy consumption of my house. It is working very well, and seems to give fairly precise measurement reports.
For monitoring of individual appliances, however, I am using Fibaro Wall Plugs (FGWPF-101). These devices are very well suited for the purpose. I am currently using these on my washing machine, drying machine, dishwasher, freezer and water heater.
Apart from being very nice devices, that are rock solid in operation, I can see the following two benefits:
Ease of use - simply plug it into the socket, and then plug your appliance into the device.
Master switch - If you happen to leave for an extended vacation, and forgot to turn off your washing machine, you can simply cut all power to the unit,
oh. I didn’t understand this on my first readovers, but now I’m getting a bit more context. So this means basically, that the Sonoff sends (regardless of the intervall set in TelePeriod) a MQTT message, if I set a low and high wattage threshold and this threshold is met?
PowerHigh | <watt> | Set power high threshold value
PowerLow | <watt> | Set power low threshold value
That’s correct. The Sonoff Pow doesn’t have a outlet, you have to connect blank wires on them, see on the picutre on the bottom from left to right: L(OUT) - E/E - N/N - L(IN).
As my Installation in the cellar is surface-mounted, I just placed them in between the wiring. But you could also splice an extension cable and put it in the middle.