Hi there all,
I want to make a rule for my son in order to let him to play with the Play Station for 2 hours.
I allready have the SonOff POW working and give me the watt number when power on whit this string in sitemap:
Text item=SonOff1Power label=“Power [%.1f Watt]” icon=“switch”
I must make e rule like:
if SonOff1Power > 10watt then add 1 every minute to the variableTotalMinutes.
When variableTotalMinutes > 120 minutes then send OFF command to the SonoffPOW item.
Can anybody please help me to make this rule please ?
I cannot give you the solution but similar requests have been made and answered repeatedly under the keyword ‘counter’, e.g., here: Generator hours counter
Maybe you can glean enough from this (and other posts regarding counters) to help you in your rule.
Wel …if I tell him to finish to play on Play Station, then he tell me that just stay in order to save the game
…and after I forget, he remain for another hour or much more.
With this project will bi controlled and the Play Station will be turned off.
I don’t think that the PS will broke if I take out the current.
I don’t understand how much times the “rule” routunes will be called during the day.
I mean… if I make a routine in the rule file, every how much time will be called ?
Rules are either “item”-triggered, meaning some item is changed or they are time-triggered (cronjob-syntax). There can also be triggered on system-status or changing of Things.
In your case, the first rule would be item-triggered (power consumption) and the second one would be time-triggered (midnight).
If you have your TV on a Switch-item, I would just make sure, the TV cant’t get power again, if the counter reached the Maximum time. So your son would not loose his game.
-every 1 min check the SonOffPow
if Sonoff is not online add 2min to a variable
That might be a way to teach him not to try to trick your setup… of course you will need another way of forcing the shutdown then. Btw. Honestly I think your son will quickly find another hack
I think is not so good this rule… or maybe I’m not understanding it cause my english
This because if he play for just 40 min and after he make a pause,
the counter must remain at 40min… in order to add another minutes when my son return to play.
O.T. The simplest way to add a voice that can be controlled by the OpenHab, near the Play Station ?
“online” means in Wifi and operational. In the position of your son, the first thing I’d do is remove the Sonoff somehow - but of course if he get’s this far nothing is stopping him from having it still connected but not to the PS. Maybe enhance the rule to be “not online OR online but 0.0 watts power reading”
how do you managed to connect sonoff POW with openhab? have you flashed the firmware and do some soldering on it?
I’ have one of it, used fora a while with its app but now I would like to deeply integrate it in a new house with openhab and was wondering how to merge the thw systems with mqtt.
There’s a full-fledged thread here for using the Tasmota-Firmware:
…and regarding the Sonoff PoW, you don’t Need soldering, you can use some Pogo Pins (you know, the cables with the Spikes on the top), just put them in the regarding holes on the platine, works perfectly.