Ahh, one more thought. Did you place your CSSInjectDevice somewhere in the GUI?
-
control visibility via device status
-
Ok, now it is:
set css “display” of “#item-lists > div > div > div:nth-child(1) > div > ul > li:nth-child(10)” to "none"
Still no effect… -
Please consider my last comment
-
Ha, no, I did not place a CSSInjectDevice.
I’ll wil try that…when I know how this device should be in the config… -
No special config. Just create a CssInjectDevice and place it somewhere in the GUI. Doesn’t matter where.
-
Ok, CssInjectDevice added.
Hide with the “none” argument now works.
But making it visible with the argument “initial” shows the device again but then two devices are mixed with each other… -
Well, then initial is not the right attribute, because another plugin changed the display value of one of the devices. Please debug the original attributes of the display property of the devices you want to hide via the Chrome developer console.
Possible values could be found here: https://www.w3schools.com/cssref/pr_class_display.asp
-
Ok, thanks, when I am home again I’ll try again.
But now it is messed up, how do I get it first right again?
I am also afraid to mess up more… -
Just restart pimatic. Then all applied styles are gone until your rules trigger a new change.
-
Ok, thanks for your support and patience.
I’ll try it later… -
I tried again on a computer screen, there it works good.
But on my Smartphone de devices are messed up after make the device visible again.
And on a thirth smartphone nothing has been hidden at all.
Doesn’t it work on both devices (computer and smartphone)? -
What is the default value of the display property of the DOM element you try to hide? After answering this question I could help you.
Please read a little bit how CSS works and try to understand the basics.
In my case it works on all smartphones and PCs.
-
I wish I understood what you mean with property of the Dom element
.
But I’ll start reading… -
You selected an element on the page that you want to hide. You right clicked and coped the selector.
This time, left click and chose “Computed” on the right hand side. Scroll to the display property and check the attribute set. This attribute has to be restored by the rule instead of initial. In the sample case its “block”
-
Ok, thanks. Now it works.
It was “block”, not “initial”.
I didn’t find the menu option “Computed” in Google Chrome but I did find it in the Internet Explorer.Thanks for the support!
-
No problem, you’re welcome.
-
Maybe still a small question…
Is it possible to use a variabel in the argument?
Like:When Lamp Voordeur is turned on then set css “visibility” of “#item-lists > div > div > div:nth-child(1) > div > ul > li:nth-child(10)” to “hidden”
Where the number 10 is a variable?
That makes it easier to add lines before the lines that i want to hide and show later…
Thanks in advance
-
No, that doesn’t seem to work.
-
With css inject I realised the following for one window contact:
This way the contact is shown when its open or the battery is low.
Also when pimatic starts the variable $cssstart is set to 1 so all the contacts are shown as they have to when Pimatic starts.This way I only see contacts that are relevant.
The downside is that I have 20 contactsensors so I need 60 rules to make. And now hoping that I don’t have to insert lines so I have to change all 60 rules.
So a better solution would be welcome and if not maybe this is an idea for others…
-
The best solution would be, that every device has its ID as identifier in the DOM. Then these awful selectors aren’t necessary any longer.
I already asked @mwittig to add this in the next pimatic release.