Page 1 of 1

Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 1:01
by lukkulis
Hello
I would like to manage sliding gate with domoticz.
I'm going to use Blinds + Stop switch for it.
So far I configured open + stop + open buttons with mqtt messages.
My question is:
How can I add addition icons to the switch/widget which would represent current state of the gate (opening, closing, stopped, opened, closed) ?
I'm going to feed icons status by mqtt messages.

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 10:53
by waltervl
You cannot have additional icons. You can change the icons to custom icons (not sure it works for Blinds), see wiki
https://www.domoticz.com/wiki/Custom_ic ... binterface

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 11:22
by psubiaco
You can have the "blind" device to open/close/stop gate, ok, but to know the real state of the gate you must have a domotic module with two inputs connected to the limit switches (so, another 2 switch devices in Domoticz), and a simple script updating anoter "TEXT device", on Domoticz, writing the current state based on limit switch state and "blind" device state.
If you need some help to do that, I can write a simple LUA script so you can try!

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 11:40
by lukkulis
Hi.
I know how to solve my issue partially.
I can use 2 switches.:
1. Blinds + Stop switch which will be dedicated for open, close and stop sliding gate.
Requesting all 3 orders by blockly scripts and mqtt messages.
2. Selector switch dedicated for gate monitoring.
Switch will contain 5 "levels" -> opening, closing,opened,closed, stopped.
"Level" will be changed by the blockly scripts which will read messages from mqtt.
My question is:
Is it possible to concatenate 2 mentioned switches into the one ?

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 19:32
by FireWizard
Hello @lukkulis

I do not know, what @waltervl means with:
You cannot have additional icons. You can change the icons to custom icons (not sure it works for Blinds), see wiki
This suggests that you can replace the standard icons for custom made icons.

This is not true.

You can create custom icons and these can be added to the default available icons.
In some cases you can change these icons "on the fly". I did not test it with a blinds device.
I use it only with a text device for my garbage calendar.

This requires a two step process.

1. Create your custom icon
- Draw it yourself.
- Copy from the internet (mind the copyrights)

Create the ZIP file. See https://www.domoticz.com/wiki/Custom_ic ... binterface
By far the easiest way is to use the icon generator: https://domoticz-icon.aurelien-loyer.fr/

After the generation check the dimensions of the PNG file. There has been a bug in the icon generator and maybe still is, which generates icon files of
50 x 50 pixels, instead of 48 x 48 pixels. This gives a white border around the icon. You can use a graphic editor, such as the GIMP, for that.
If it happens to you, correct that in the graphics editor and recreate the ZIP file.

Upload the ZIP file. If you are successful, you will see something as below:

Screenshot_custom icons1.png
Screenshot_custom icons1.png (90.52 KiB) Viewed 891 times
If everything has been done correctly, you will see your icon and if it is possible you will find it also in the row of selectable icons.

Screenshot_custom icons2.png
Screenshot_custom icons2.png (38.57 KiB) Viewed 891 times
2. To use these icons you have to know the id of these icons.

You can find these as follows:

Code: Select all

cd <domoticz dir>
sudo sqlite3 -header domoticz.db " select id+100 id ,name from customimages"
Mostly, at least on a Raspberry Pi, your domoticz dir will be ~/domoticz.

In this case the command will give you:

Code: Select all

id|Name
101|OpenAQ
102|Buienradar
103|Buienradar
104|Solar
105|Camera
106|NAS
108|MoonPhases1NM
109|MoonPhases2WC
110|MoonPhases3FQ
111|MoonPhases4WG
112|MoonPhases5FM
113|MoonPhases6WG
114|MoonPhases7LQ
115|MoonPhases8WC
116|Button GFT
117|Button Restafval
118|Button PMD
119|Button Papier
120|Button Air_Quality
121|Button FixedLinePhone
Remember the id, you want to use.

You cannot send the id of the icon with MQTT, but you have to use HTTP.
See the WIKI: https://www.domoticz.com/wiki/Domoticz_ ... vice_types

Imagine that you want to use the Purple button (PMD), you have to give the following command:

Code: Select all

url//json.htm?type=setused&used=true&name=Afvalkalender&idx=497&switchtype=0&customimage=118
This will give you the following (in this case a text sensor) widget.

Screenshot_custom icons3.png
Screenshot_custom icons3.png (51.94 KiB) Viewed 891 times
Regards

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 23:14
by lukkulis
Hello.
My goal was to add few more icons into the blinds switch. I would like to manage status of mentioned additioonal icons by mqtt messages.

Re: Sliding Gate and Blinds

Posted: Tuesday 14 June 2022 23:32
by waltervl
Alternative could be to use a selector switch and use ASCIi symbols as icons. See the following topic for an example: viewtopic.php?t=36640