Beiträge von falkenstein

    Guten Abend,

    87insane

    ich habe einen Shelly1 mit einem Magnetkontakt der an einen Tor befestigt ist. Diesen Magnetschaltermmöchte ich gern noch zusätzlich in Fhem per MQTT2 darstellen,ob das Tor gerade geöffnet oder geschlossen ist. So einfach per devStateIcon geht das leider nicht.

    Hier ein List aus FHEM:


    Internals:
    CID shelly1_8CAAB561AAF7
    DEF shelly1_8CAAB561AAF7
    DEVICETOPIC MQTT2_shelly1_8CAAB561AAF7
    FUUID 614c3048-f33f-4b78-630d-a1615d6cca9820df
    IODev MQTT2
    LASTInputDev MQTT2
    MQTT2_MSGCNT 1008
    MQTT2_TIME 2021-09-29 19:48:44
    MSGCNT 1008
    NAME MQTT2_shelly1_8CAAB561AAF7
    NR 124
    STATE off
    TYPE MQTT2_DEVICE
    OLDREADINGS:
    READINGS:
    2021-09-29 17:03:04 IODev MQTT2
    2021-09-29 19:20:54 attrTemplateVersion 20200831
    2021-09-29 19:48:44 ext_switch_0 0
    2021-09-29 19:20:54 fw_ver 20210909-144114/v1.11.4-DNSfix-ge6b2f6d
    2021-09-29 19:20:54 id shelly1-8CAAB561AAF7
    2021-09-29 19:20:54 info_actions_stats_skipped 0
    2021-09-29 19:20:54 info_cfg_changed_cnt 0
    2021-09-29 19:20:54 info_cloud_connected false
    2021-09-29 19:20:54 info_cloud_enabled false
    2021-09-29 19:20:54 info_ext_switch_0_input 0
    2021-09-29 19:20:54 info_fs_free 151102
    2021-09-29 19:20:54 info_fs_size 233681
    2021-09-29 19:20:54 info_has_update false
    2021-09-29 19:20:54 info_inputs_1_event
    2021-09-29 19:20:54 info_inputs_1_event_cnt 1
    2021-09-29 19:20:54 info_inputs_1_input 1
    2021-09-29 19:20:54 info_mac 8CAAB561AAF7
    2021-09-29 19:20:54 info_meters_1_is_valid true
    2021-09-29 19:20:54 info_meters_1_power 0.00
    2021-09-29 19:20:54 info_mqtt_connected true
    2021-09-29 19:20:54 info_ram_free 37260
    2021-09-29 19:20:54 info_ram_total 50872
    2021-09-29 19:20:54 info_relays_1_has_timer false
    2021-09-29 19:20:54 info_relays_1_ison false
    2021-09-29 19:20:54 info_relays_1_source timer
    2021-09-29 19:20:54 info_relays_1_timer_duration 0
    2021-09-29 19:20:54 info_relays_1_timer_remaining 0
    2021-09-29 19:20:54 info_relays_1_timer_started 0
    2021-09-29 19:20:54 info_serial 3
    2021-09-29 19:20:54 info_time 19:20
    2021-09-29 19:20:54 info_unixtime 1632936054
    2021-09-29 19:20:54 info_update_has_update false
    2021-09-29 19:20:54 info_update_new_version 20210909-144114/v1.11.4-DNSfix-ge6b2f6d
    2021-09-29 19:20:54 info_update_old_version 20210909-144114/v1.11.4-DNSfix-ge6b2f6d
    2021-09-29 19:20:54 info_update_status idle
    2021-09-29 19:20:54 info_uptime 21922
    2021-09-29 19:20:54 info_wifi_sta_connected true
    2021-09-29 19:20:54 info_wifi_sta_ip 192.168.1.190
    2021-09-29 19:20:54 info_wifi_sta_rssi -50
    2021-09-29 19:20:54 info_wifi_sta_ssid UniFi
    2021-09-29 19:48:44 input0 1
    2021-09-29 19:20:54 ip 192.168.1.190
    2021-09-29 19:20:54 mac 8CAAB561AAF7
    2021-09-29 19:20:54 model SHSW-1
    2021-09-29 19:20:54 new_fw false
    2021-09-29 19:20:54 online true
    2021-09-29 19:48:44 relay0 off
    2021-09-29 19:48:44 state off
    Attributes:
    devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";
    my $input = ReadingsVal($name,"input0","0") eq "1"?'fts_garage_door_100@green':'lfts_garage_door_10@reed';;
    my $light = ReadingsVal($name,"state","off"); my $show = '" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">'; $show .= FW_makeImage("10px-kreis-".$onl).""; "

    $show ".FW_makeImage($light)."

    " }
    event-on-change-reading .*
    genericDeviceType garage
    homebridgeMapping CurrentDoorState:input0,values=0:OPEN;;1:CLOSED;;2:OPENING;;3:CLOSING;;4:STOPPED
    TargetDoorState:CurrentDoorState,cmds=OPEN:on;CLOSED:off
    model shelly1
    readingList shellies/shelly1-8CAAB561AAF7/relay/0:.* state
    shellies/shelly1-8CAAB561AAF7/relay/0:.* relay0
    shellies/shelly1-8CAAB561AAF7/input/0:.* input0
    shellies/shelly1-8CAAB561AAF7/online:.* online
    shellies/shelly1-8CAAB561AAF7/announce:.* { json2nameValue($EVENT) }
    shellies/announce:.* { $EVENT =~ m,..id...shelly1-8CAAB561AAF7...mac.*, ? json2nameValue($EVENT) : return }
    shelly1_8CAAB561AAF7:shellies/shelly1-8CAAB561AAF7/info:.* { json2nameValue($EVENT, 'info_', $JSONMAP) }
    shelly1_8CAAB561AAF7:shellies/shelly1-8CAAB561AAF7/ext_switch/0:.* ext_switch_0
    room MQTT2_DEVICE
    setList off:noArg shellies/shelly1-8CAAB561AAF7/relay/0/command off
    on:noArg shellies/shelly1-8CAAB561AAF7/relay/0/command on
    x_update:noArg shellies/shelly1-8CAAB561AAF7/command update_fw
    x_mqttcom shellies/shelly1-8CAAB561AAF7/command $EVTPART1

    Kann mir jemand mal bitte helfen,wie ich noch zusätlich das devStateIcon von meinen Tor (Magnetschalter) in Fhem mit darstellen kann?

    Schon mal vielen Dank im voraus,

    Beste Grüße

    Falkes