Washing Machine State Machine

power
Tags: #<Tag:0x00007f0e8ce6a540>

(Udo Hartmann) #142

Did you take a look at mqtt? Maybe something has changed slightly and you have to redefine your items.


(Daniel N.) #143

I have not made any changes to the MQTT, just the update of the Sonoff Pow R2 to 6.01

When the machine is on and active, everything works perfectly, but after the wash, the energy item goes to 0 and stays there (no more log entries). Before the update, there were always fluctuations between 0 and 1.2W (when the machine was on and not active)

I’ll try the downgrade to 5.11 or are there commands to make the POW “sensitive”?

My Config:

Number      kel_wmaschine           "Waschmaschine läuft? [MAP(tag.map):%s]"        <wmaschine>         (gKel, gInfo)
Number      kel_wmaschine_energy    "Waschmaschine [%.2f W]"                        <stromver>          (gKel, gEnergy)                         {mqtt="<[broker:tele/sonoff_CE0772/SENSOR:state:JSONPATH($.ENERGY.Power)]"}
Number      kel_wmaschine_geenergy  "Waschmaschine - Gesamtverbrauch [%.2f kwh]"    <stromver>          (gKel, gEnergy)                         {mqtt="<[broker:tele/sonoff_CE0772/SENSOR:state:JSONPATH($.ENERGY.Total)]"}
Number      kel_wmaschine_rssi      "Waschmaschine Empfang: RSSI [%d %%]"           <wlan>              (gKel, gEmpfang)                        {mqtt="<[broker:tele/sonoff_CE0772/STATE:state:JSONPATH($.Wifi.RSSI)]"}
val Number MODE_OFF = 0
val Number MODE_STANDBY = 1
val Number MODE_ACTIVE = 2
val Number MODE_FINISHED = 3

rule "Waschmaschine Aktivitätsregel"
when
    Item kel_wmaschine_energy changed
then
    if (kel_wmaschine_energy.averageSince(now.minusMinutes(2)) < 0.5) kel_wmaschine.postUpdate(MODE_OFF)
    else if (kel_wmaschine_energy.averageSince(now.minusMinutes(2)) > 10) kel_wmaschine.postUpdate(MODE_ACTIVE)
    else if (kel_wmaschine_energy.averageSince(now.minusMinutes(2)) < 5) {
        if (kel_wmaschine.state == MODE_OFF) kel_wmaschine.postUpdate(MODE_STANDBY)
        else if (kel_wmaschine.state == MODE_ACTIVE) kel_wmaschine.postUpdate(MODE_FINISHED)
    }
end

rule "Waschmaschine Benachrichtigung"
when
    Item kel_wmaschine changed to 3
then
    if (nog_tag.state == "ON") {
        sendCommand(gw_soundvolume, 10)
		sendCommand(gw_sound, 29)
		Thread::sleep(9000) /* wait for 9 seconds */
		sendCommand(gw_sound, 10000)
		sendCommand(gw_soundvolume, 0)
        whz_echo_tts.sendCommand('Daniel, die Waschmaschine ist fertig!')
    }
	else if (nog_tag.state == "OFF")
		sendPushoverMessage(pushoverBuilder("[openHAB - Info] Deine Waschmaschine ist fertig!"))
end
broker.url=tcp://openhabxxxxxxxxx:1883
broker.clientId=OpenHAB2
broker.user=openhabian
broker.pwd=xxxxxxx
broker.qos=0
broker.retain=true
broker.async=false

(Udo Hartmann) #144

I should have been more clear :slight_smile:

Did you take a look at the mqtt data? (i.e. start mqttspy, connect to your broker, subscribe to # (or at least to the topic tele/sonoff_CE0772/#) and wait until some data was received).


(Daniel N.) #145

thanks for the Answer and sorry.

Now i fix it.

The problem was the update of the Sonoff POW R2 to Tasmota version 6.1.0, with this version the low-engery measurements are more than bad. I flashed Sonoff back to version 5.12 and it works. Now I get measurements around 0 to 1.2W in standby (machine on, but not active)


(Michael Ingraham) #147

@Likonaus

I hope that you were able to get an answer to your year old question by now. But in case you hadn’t…

I had the same issue. It seems that if openHAB encounters some kind of fault, it does a crash dump of sorts into the log. This includes some non-printable characters or some flat out binary content. In order for grep to read such a file, tell it to “accept binary file as input” using the ‘-a’ command line option.

Mike


(black0r) #148

Im new in Openhab 2 (im coming from fhem) and have a working homegear integrated CCU2 - I want to setup the washingmaschine with an Homematic HM-ES-PMSw1 - it works also correct under things - but how the hell I get the correct rule for that thing and add it to my sitemap like in first post ? Cause my confusion comes from the *.items … cause as i think i dont need an item file if its connected as thing ?


(Sebastian) #149

Hey @black0r1337
in most cases one would need an item linked to the thing. Generally speaking the thing is a device which may contain multiple channels. Like a power plug that can be switched on/off but also reports watts/amps/etc.
Then you have the hardware device as thing and the items as the channels tied to it. You can find a nice docu on https://www.openhab.org/docs/concepts/things.html & https://www.openhab.org/docs/concepts/items.html.

Thus you have to create items based on your thing in order to have the rule listen for changes on your configured item.


(black0r) #150

Hi Sebastian, thanks for the answer - you have maybe an example - to be clearer dont understand it correct :confused:


(Sebastian) #151

I dont own your HM-ES-PMSw1, but for a different Homematic device a config might look like this:
homematic.things:

     Thing HM-Sec-RHS    LEQ1248XXX  "eg_esszimmer_fenster" @ "Esszimmer"

and the corresponding eg_esszimmer_fenster,items (shortend)

 String eg_esszimmer_fenster
     "Esszimmer [MAP(contact3.map):%s]"
     { channel="homematic:HM-Sec-RHS:ccu2:LEQ1248XXX:1#STATE" }

 Switch eg_esszimmer_fenster_lowbat
     "Esszimmer Fenster Batterie [MAP(hmbattery.map):%s]"
     { channel="homematic:HM-Sec-RHS:ccu2:LEQ1248XXX:1#LOWBAT" }

As you can see the thing is referenced in items definition. I’m a bit old-school doing all the config in files still. You’re able to do the same via PaperUI.

You task is to create an item that holds the power consumption of your thing. Once you can have that, you can continue in writing the rule acting basen on the metered consumption.


(black0r) #152

now i got it ! thanks Sebastian !

Must I create *.map files by my own or whats the purpose of that ?