Seite 1 von 1

OH3 Thing für MQTT Homeassistant

Verfasst: 23. Mär 2022 01:34
von zacc
Hallo,

kann man mit VSC ein Thing für Homeassistant Autodiscovery schreiben?
Bzw so wie mein Valetudo direkt die Channel anlegen?

wie zb:

Code: Alles auswählen

Thing mqtt:topic:valetudo "roborock" (mqtt:broker:MosquittoMqttBroker) 
  {
    Channels:
        Type number : batterylevel      "Batterylevel"    	 	          [ stateTopic="valetudo/roborock/BatteryStateAttribute/level"]
        Type string : batterystatus	    "Batterystatus"    	 	          [ stateTopic="valetudo/roborock/BatteryStateAttribute/status"]
        Type string : fanspeed		      "Fanspeed"      	              [ stateTopic="valetudo/roborock/FanSpeedControlCapability/preset", commandTopic="valetudo/roborock/FanSpeedControlCapability/preset"]
        Type string : commando          "Robo Start"          			    [ stateTopic="valetudo/roborock/BasicControlCapability/operation", commandTopic="valetudo/roborock/BasicControlCapability/operation/set" ] //, transformationPattern="JSONPATH:$.state" ]
        Type string : docking	          "Docking status"    	 	        [ stateTopic="valetudo/roborock/StatusStateAttribute/status"]
  }
Bild


Danke für Rückmeldungen

Mfg

Re: OH3 Thing für MQTT Homeassistant

Verfasst: 23. Mär 2022 10:35
von udo1toni
In dem Moment, wo Du es über eine *.things Datei anlegst, ist es manuell konfiguriert und nicht mehr Autodiscovery.
Grundsätzlich sollte aber jegliches Thing, welches per Autodiscovery im System landet, auch manuell hinzugefügt werden können.
In diesem Fall würde es so reichen:

Code: Alles auswählen

Thing mqtt:topic:dc4f2248be56 "roborock" (mqtt:broker:MosquittoMqttBroker) 
  {
    Channels:
        Type number : pm25        "Partikel"     [ stateTopic="dc4f2248be56/PM2_5/state" ]
        Type number : co2         "Kohlendioxid" [ stateTopic="dc4f2248be56/CO2/state" ]
        Type number : temperature "Temperatur"   [ stateTopic="dc4f2248be56/Temperature/state" ]
        Type number : humidity    "Luftfeuchte"  [ stateTopic="dc4f2248be56/Humidity/state" ]
  }

Re: OH3 Thing für MQTT Homeassistant

Verfasst: 29. Mär 2022 19:11
von zacc
@udo1toni Danke für Hilfe... es hat gleich aufanhieb funktioniert :)