Farbe eines "switch" beim Auslösen durch Sensor

Begonnen von Helmi55, 09 Mai 2016, 19:09:40

Vorheriges Thema - Nächstes Thema

Helmi55

Hallo guten Abend
habe ein kleines kosmetisches Problem:
<li data-row="3" data-col="2" data-sizex="1" data-sizey="1">
        <header class="cell" ></header>
        <div data-type="switch"
     data-device="Gartenbeleuchtung"
             data-set-on="off"
             data-set-off="on"
             data-get-on='["off","on"]'
             data-icon="fa-power-off"
             data-background-colors='["red","green"]'
             class="bigger" >
        </div>   
        <div data-type="label" class="bold">Gartenlicht</div>
</li>


Wenn ich über FTUI den switch schalte sind die Farben rot/grün. Wenn aber durch einen Sensor und DOIF ausgelöst wird, ist er grau?
(([GaragenTor] eq "Offen") and [?[Daemmerung:ss]-23:59]) (set Gartenbeleuchtung on-for-timer 900) DOELSE

Warum?
Danke
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

roman1528

Zitat von: Helmi55 am 09 Mai 2016, 19:09:40
Hallo guten Abend
habe ein kleines kosmetisches Problem:
<li data-row="3" data-col="2" data-sizex="1" data-sizey="1">
        <header class="cell" ></header>
        <div data-type="switch"
     data-device="Gartenbeleuchtung"
             data-set-on="off"
             data-set-off="on"
             data-get-on='["off","on"]'
             data-icon="fa-power-off"
             data-background-colors='["red","green"]'
             class="bigger" >
        </div>   
        <div data-type="label" class="bold">Gartenlicht</div>
</li>


Wenn ich über FTUI den switch schalte sind die Farben rot/grün. Wenn aber durch einen Sensor und DOIF ausgelöst wird, ist er grau?
(([GaragenTor] eq "Offen") and [?[Daemmerung:ss]-23:59]) (set Gartenbeleuchtung on-for-timer 900) DOELSE

Warum?
Danke
Helmut

Weil er die option on-for-timer nicht behandelt.. sondern nur on und off!

check mal das:

<li data-row="3" data-col="2" data-sizex="1" data-sizey="1">
        <header class="cell" ></header>
        <div data-type="switch"
     data-device="Gartenbeleuchtung"
             data-states='["off","on","on-for-timer.*"]'
             data-set-states='["on","off",""]'
             data-icons='["fa-power-off","fa-power-off","fa-power-off"]'
             data-background-colors='["red","green","green"]'
             class="bigger" >
        </div>   
        <div data-type="label" class="bold">Gartenlicht</div>
</li>


Du solltest ruhig data-states und data-set-states verwenden... dafür wurden sie gemacht.
bei data-set-states habe ich die 3. option leer gelassen. somit kann man gar nix schalten wenn on-for-timer an ist. du könntest hier aber auch off eintragen.. dann kannst du die lampe oder ähnliches manuell ausschalten wenn sie durch einen bewegungsmelder angeschaltet wurde.  ;)

grüße^^
i3-10305T 4x3GHz;8GB RAM;250GB & 1TB NVMe:
FHEM 6.2;FTUI;8" Tablet's+Fully;NsPanelPro;HUE;ESPRGBWW;HM(CCU3);Duofern; ASC;MQTT(Tasmota);netatmo;SONOS;eBus;DbLog;XiaomiDevice;NUT;ModbusAttr

RPi3+: FHEM 6.2;I²C;GPIO;RFID;G-Tag;XiaomiBTLESens
RPi3: FHEM 6.2;DIY Relais-Board;I²C;GPIO;RFID;Photovoltaik

Helmi55

Ja, danke. So funktioniert es.
Und natürlich herzlichen Dank für deine ausführliche Beantwortung.
Liebe Grüße Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

roman1528

i3-10305T 4x3GHz;8GB RAM;250GB & 1TB NVMe:
FHEM 6.2;FTUI;8" Tablet's+Fully;NsPanelPro;HUE;ESPRGBWW;HM(CCU3);Duofern; ASC;MQTT(Tasmota);netatmo;SONOS;eBus;DbLog;XiaomiDevice;NUT;ModbusAttr

RPi3+: FHEM 6.2;I²C;GPIO;RFID;G-Tag;XiaomiBTLESens
RPi3: FHEM 6.2;DIY Relais-Board;I²C;GPIO;RFID;Photovoltaik

Helmi55

Hallo Roman
ich habe jetzt einige Zeit gesucht, wurde aber nicht fündig
Wo steht das Du solltest ruhig data-states und data-set-states verwenden... dafür wurden sie gemacht.
Auch in der Doku auf GitHub steht dazu nichts
Schöne Pfingsten
LG
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

roman1528

Moin.

ZitatSwitch widgets

    data-get : name of the reading to get from FHEM (default 'STATE')
    data-set : name of the reading to set from FHEM (default '')
    data-cmd : name of the command (<command> <device> <reading> <value>) (e.g. setstate, set, setreading, trigger) default: 'set'
    data-doubleclick: timeout to wait for x millisecondes click or touch. '0' disables the doubleclick feature. (default '0')

dual state notation

    data-get-on : value for ON status to get or an array of states (default 'on')
    data-get-off : value for OFF status to get. (default 'off')
    data-set-on : value for ON status to set. (default: value of data-get-on)
    data-set-off : value for OFF status to set. (default: value of data-get-off)
    data-icon : name of the font-awesome icon. (default: fa-lightbulb-o)
    data-background-icon : name of the font-awesome icon for background (default 'fa-circle')
    data-on-background-color : color for ON state or DEVICE:READING for dynamic setting (default '#aa6900')
    data-off-background-color : color for OFF state or DEVICE:READING for dynamic setting (default '#505050')
    data-on-color : color for ON state or DEVICE:READING for dynamic setting (default '#aa6900')
    data-off-color : color for Off state or DEVICE:READING for dynamic setting (default '#505050')

multi state notation

    data-states : array of states
    data-set-states : array of states to set.
    data-icons : array of icons related to the data-states array
    data-background-icons : array of background icons related to the data-states array
    data-colors : array of colors related to the data-states array
    data-background-colors : array of background colors related to the data-states array
    class : readonly,

Steht ja woooohl  :P

Stichwort: multi-state-notation

Weil du mehr als zwei Zustände hast/haben willst.

Grüße^^
i3-10305T 4x3GHz;8GB RAM;250GB & 1TB NVMe:
FHEM 6.2;FTUI;8" Tablet's+Fully;NsPanelPro;HUE;ESPRGBWW;HM(CCU3);Duofern; ASC;MQTT(Tasmota);netatmo;SONOS;eBus;DbLog;XiaomiDevice;NUT;ModbusAttr

RPi3+: FHEM 6.2;I²C;GPIO;RFID;G-Tag;XiaomiBTLESens
RPi3: FHEM 6.2;DIY Relais-Board;I²C;GPIO;RFID;Photovoltaik

Helmi55

Man(n) sollte vielleicht doch immer bis zum Ende lesen.....😂😂
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/