Service came back at 11:30h. For now it works again.
New plugin pimatic-gBridge
Even though the gBridge service is currently running a bit bumpy I would like to ask for an extension.
I think shutter could be a helpfull device to control over gBridge. Nice would be to use the type dimmer to set the right position.
“Set Shutter X to 25%” would be a nice way to control shutters while pimatic is not able to move to a certain position.
I think its “ShutterController”
I have played little bit with your code. The problem is pimatic related, because it provides not the necessary infos to set a slider/dimmer.
I got this error:
Error getting devices: TypeError: this.device.getState is not a function
The ShutterController needs to be extended by a position value to make it possible I think.
The easiest way would be to use a dummy dimmer which will send a command via a rule to move shutters to the right position. Not elegant, but it should work with the current plugin version…
A shellDimmer would be nice by the way.
@ortin the pimatic shutterController isn’t capable of setting a position. Is just has 3 states (up, stopped, down).
I assume the shutters don’t provide any information on the position.
When you start the plugin the shutter needs to be in a known position (anything between 0 - 100) or forced into a position (open or closed). What do you prefer?
The DummyDimmer idea will not be better because you still need a starting position.
I released a new version of the plugin 0.2.16 with support of the ShutterController device.
On startup the device sets the shutter to 0 (for syncing) after that you can use voice commands for relative position of the shutter. Let me know if this works.
Will check it this evening!
EDIT: I was nosy
Something went wrong my gBrdge device seems to be broken. No more sub devices are visible…
Thx, gBridge now working again.
I got a message that no rolling time is configured :
Error getting devices: Error: No rolling time configured.
I am using the shellShutter device for my Shelly’s. RollingTime is not available there.
I wrote a script which handles up/down/0-100.
The call for 50% would look like this:
sh /home/user/subfolder/script.sh $mode $room 50
Within the script the specific shelly command is:
@ortin so your shutters support position commands. How do you configure the ShellShutter for the position command. Is that the ‘getPositionCommand’? I don’t see a ‘setPositionCommand’
Currently I run the shutters over the UI up and down only. States between must be stopped manually. Via rules I run to special positions to realize sun protection for example. The state and position will be detected via “getPositionCommand” every 60s only. Yeah it pretty long intervall, but I had also tested it with 1000ms interval, but the CPU went over 70% after I configured it for my 8 devices.
My script is very lightweight. I use curl to get the state which comes in json format and piping all the stuff to get to the values “up/down/stop” and “currentPosition”. The stop command releases the buttons on the UI and the currentPositions are written in a modul related variable in pimatic. Maybe too much for my VM…
I have to extend it to get the state only during shutters are running. It planned to go for it at the weekend. Then the intervall could be much shorter.
What would be nice is to define a command in the gBridge device which will be extended by the GA return value.
For example I say: “Hey Google, shutter bla 50%”. GA will set the shutter to 50 in the cloud. This value could be read back and then extend a pre defined command in the gBridge shutter sub device.
With pre defined command I mean
sh /home/user/subfolder/script.sh mode room $readBackValueor
http://192.168.x.x/roller/0?go=to_pos&roller_pos=$readBackValueor what ever the user defines.
Just a fast example:
@ortin thanks for the insights.
I would like the device config to be as generic as possible.
I will introduce a generic aux of that will be used if an adapter has specific needs.
For the shutter it will be the position shell command. The position value (0-100) will be added by the plugin with a space at the end of the aux field.
The getPositionCommand of the ShellShutter gives only ‘moving type’ status: ‘up’, ‘down’ or ‘stopped’ and not a % position! The position value will be hold in the plugin-adapter. GA will get that info when GA askes for status. In Pimatic this value is not visible. You can see of course the shutters position when you look …
On startup the position sync is still an issue. But when the shutters are fully opened or closed, its easy to sync the position (if there’s an auto stop safety).
If your script returns the real position, that could also be used as the position value
Sure, was just a brain stroming from my side
I like your generic aux approach! Regarding position determination. What about an optional, interval triggered
auxGetValuecommand option beside the general aux. This value could handle the position sync issue with GA if, let us stick with the example shutters where controlled by UI or old school via wall switch?
@ortin i just released a version with one aux command line. The result value of that command is used as position value. If you extend your script with the position as result value, this would work.
You could also change your function into moveByPercentage, with a maximum value from -100 (fully down) to 100 (fully up). You always return the resulting position.
When you ask for moveByPercentage 0, you only return the current position.
The absolute position getting from GA is translated in the plugin to the relative position for the shutter.
Let me know if this is an option for you, so it can change the adapter
Okay, first test lets my test shutter dancing behind me. Nice work! Thx for this!!! I tested commands like "open shutter, close shutter, set shutter to 25%… All works!
I see currently GA doesn’t shows position. Maybe this will come in future. This was my idea behind the separate “getAusValue” which could be interesting btw for temperature response as well. If some value change independently from GA, GA will be updated continuously.
The aux option opens the door for many new goodies !
I forgot to say that I extend my script in that way, that it returns now a json format return value like