[SOLVED] Sonoff Tasmota Power State undefined


my first post, yeah! :wink:

I have a Sonoff POW und all is running fine. Except when i edit and save my sonoff.itmes file, the Switch lost the State and is “NULL”?

Switch Waschmaschine "Waschmaschine" {mqtt=">[broker:cmnd/Waschmaschine/POWER:command:*:default],

How can i persist the Power-State of the switch? I tried rrd4j but it seemed not working.
Another idea is to uses a Proxy-item to store the current Power-state reported from the telemetry of the POW and used a rule to postUpdate to the Switch:

Switch Waschmaschine_Proxy {mqtt="<[broker:tele/Waschmaschine/STATE:state:JSONPATH($.POWER)]"}

Or is there another way to solve the Problem?

mapdb is probably the best persistence service if you only want to persist a state so that you can restore on startup or when your .items are reloaded.

1 Like

Great, i’ll try it! Thanks! :+1:

Works! :grinning:

I just install mapdb persistance and this is my mapdb.persist file:

Strategies {
    everyDay     : "0 0 0 * * ?"
    default = everyChange
Items {
    * : strategy = everyChange, everyDay, restoreOnStartup