Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florian-asche/da437247dc850b69fef5073a3ffa2752 to your computer and use it in GitHub Desktop.
Save florian-asche/da437247dc850b69fef5073a3ffa2752 to your computer and use it in GitHub Desktop.
FHEM - MQTT - GOSUND
### MQTT
define mqttserver MQTT 127.0.0.1:1883
###########
# TASMOTA #
###########
# topic = gosund_%04d
# full_topic = /%topic%/%prefix%/
define gosund_6605 MQTT_DEVICE
attr gosund_6605 IODev mqttserver
attr gosund_6605 alias Wohnzimmer - Licht
attr gosund_6605 group Wohnzimmer
attr gosund_6605 icon message_socket
attr gosund_6605 retain 1
attr gosund_6605 room Alle,Wohnzimmer
attr gosund_6605 stateFormat state
attr gosund_6605 devStateIcon off:off:on on:on:off offline:WLAN_Status.0:on
attr gosund_6605 eventMap OFF:off ON:on
attr gosund_6605 icon message_socket
attr gosund_6605 event-min-interval .*:1800
attr gosund_6605 event-on-change-reading .*
attr gosund_6605 publishSet on off /gosund_6605/cmnd/POWER
attr gosund_6605 stateFormat {ReadingsVal($name,"precence","") eq "offline" ? "offline" : ReadingsVal($name,"state","")}
attr gosund_6605 subscribeReading_precence /gosund_6605/tele/LWT
attr gosund_6605 subscribeReading_sensor /gosund_6605/tele/SENSOR
attr gosund_6605 subscribeReading_setup /gosund_6605/tele/STATE
attr gosund_6605 subscribeReading_info1 /gosund_6605/tele/INFO1
attr gosund_6605 subscribeReading_info2 /gosund_6605/tele/INFO2
attr gosund_6605 subscribeReading_info3 /gosund_6605/tele/INFO3
attr gosund_6605 subscribeReading_result /gosund_6605/stat/RESULT
attr gosund_6605 subscribeReading_state /gosund_6605/stat/POWER
attr gosund_6605 webCmd on:off
define Gosund_expandSENSOR expandJSON gosund_.*:sensor:.(.*);
attr Gosund_expandSENSOR room System
define Gosund_expandSETUP expandJSON gosund_.*:setup:.(.*);
attr Gosund_expandSETUP room System
define Gosund_expandINFO1 expandJSON gosund_.*:info1:.(.*);
attr Gosund_expandINFO1 room System
define Gosund_expandINFO2 expandJSON gosund_.*:info2:.(.*);
attr Gosund_expandINFO2 room System
define Gosund_expandINFO3 expandJSON gosund_.*:info3:.(.*);
attr Gosund_expandINFO3 room System
define Gosund_expandRESULT expandJSON gosund_.*:result:.(.*);
attr Gosund_expandRESULT room System
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment