State O-Matic Binding - Monitor your Washingmachine / Dishwasher / Electric Car Etc

Added BETA1 build with fix for quantity energy items.

It seems as if entered Power or Energy Input Item isn’t available at the moment of Thing initialization, it fails thing setup. Makes sense, but required item availability should be re-checked after a period.
I came across this while updating OH3.3 milestone 3 to 4, with a clean-cache. Bindings from add-ons folder are activated 1st, other bindings and items from files are created later. The measuring Power Input Item didn’t exist on Thing creation, corresponding error message appeared: “No item could be found for PowerInputItem name:”. I could easily fix this by a later manual pause/resume of my State Machines.

Btw. editing things-file from working setup to failing setup (to test unavailable item info), binding validly fails. Yet, when correcting the item info in things-file, thing doesn’t catch the change and stays failed. Only removing the thing and recreating helps here.

Not sure anything can be done on the binding level to fix this. Thing and binding initialization is mostly handled by openhab.

hi! just one question: the binding on the marketplace is already the latest beta version or is the first alpha?

The one in marketplace is the latest beta version.

Best regards s

1 Like

Hello. I have the same problem as Ruben and Zs B. Everything is ok when I use Static Power(W). But when the Power Input Item is not a switch, but a Number - Openhab hangs after a few hours. Great binding, but unfortunately I can’t use it with energy monitors, only with statics. Is there a way to fix the problem? What information do I need to provide?

What version of the binding are you using?
I run 8 state machines with power input from various z-wave devices.
You can check in the karaf-console

Run


[22:36:54] openhab@stardust:~/$ ssh -p 8101 openhab@127.0.0.1
Password authentication
Password: 

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       3.4.0-SNAPSHOT - Build #2980

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

openhab> bundle:list |grep -i State
 ID │ State  │ Lvl │ Version                │ Name
234 │ Active │  80 │ 3.2.0.202204012050     │ openHAB Add-ons :: Bundles :: State O-Matic Binding
openhab>

One thing that I have noticed is that sometimes during startup, the things fails to come online since the items are not available on the eventbus yet. I’ll try to add a timer to initialize the statemachines a bit later. If this happens you can manually in the gui press pause and then play on the thing to reinitialize it.

Thanks for replying me. Version of the binding is 3.3.0.202204252101

Is the state machine cycled during that time? I.e going from started to finished?
Do you have any errors in your openhab.log?
Is it working at all for you with numbers? Is the issue that it works but hangs after a certain time or not working at all?
How is your item defined? Are you using text or GUI? Is it a Quantity?

/S

Yes. First Item is Air conditioner, second is Boiler

No, openhab.log looks ok

Yes. With numbers there are 3 Items (Lights). Works fine for over a month

It works but hangs after a certain time. Several hours to 2 days maximum

GUI. No Quantity just Number. Only Semantic Classification: Point_Measurement (Property_Power). Item has an expiration timer for 1 min with UNDEF state. Maybe this is the problem?

Could be. Can you try and define the item in a text configuration? I have never tried to use an item with expire on it.

Ok. I will try. Thank you

How can I change the logger level?
I tried

log:set WARN org.openhab.binding.omatic

from the console but I get an error message.

openhab> log:set WARN org.openhab.binding.omatic
Error executing command: Unable to set level for logger

Are you sure the binding is installed? This works for me at least.

Check with:

openhab> bundle:list |grep -i State
 ID │ State  │ Lvl │ Version                │ Name
234 │ Active │  80 │ 3.2.0.202204012050     │ openHAB Add-ons :: Bundles :: State O-Matic Binding

Yes the binding is installed an running. I have frequently print outs, too. I have to say thet I am on openHAB 3.4.0.M5

openhab> bundle:list |grep -i State
 ID x State  x Lvl x Version                x Name
235 x Active x  80 x 3.3.0.202204252101     x openHAB Add-ons :: Bundles :: State O-Matic Binding
openhab> list -s | grep omatic
235 x Active x  80 x 3.3.0.202204252101     x org.openhab.binding.omatic
openhab>
2022-12-11 08:19:50.145 [INFO ] [al.handler.OMaticMachineThingHandler] - [fridge] State Machine completed time:  50m 50s, energy(measured): 0.021000000000015007, energy(estimated): 0.02451734987414599
2022-12-11 09:19:02.318 [INFO ] [tic.internal.api.model.OMaticMachine] - [fridge] Starting state Machine: 2022-12-11 09:19:02
2022-12-11 09:39:52.694 [INFO ] [al.handler.OMaticMachineThingHandler] - [fridge] State Machine completed time:  20m 50s, energy(measured): 0.009999999999990905, energy(estimated): 0.009628014642549526
2

Thanks for this binding. I have been using the statemachine rule provided by the community, now trying to transfer to this binding.
One thing I’m wondering is how can the state machine be reset to “Not started”? After a single cycle it ends in “Complete”. Would be nice if after a configurable timeout, the state reverts to “Not started”, or if it would be possible to reset the state with a command.
Thanks!

I solved this by making the following entry directly in the log4j2.xml file (Raspberry Pi under /var/lib/openhab/etc/).

	<Loggers>
		...
		<!-- Binding logger -->
		<Logger level="WARN" name="org.openhab.binding.omatic"/>

	</Loggers>

Did you have a look at this? Can this perhaps be implemented?

Hi!

Yes possibly or have it as a configuration for the statemachine. I’ll see if I can add this in the future.

Best regards s