Hi All,
I am trying to read a DHT22 device and control the speed of a fan using the homie receiver mqtt on espeasy.
The DHT reader is working.
I have defined a device as a generic homie receiver.
I have defined Function#1 with the event FanSpeed, type integer.
The other three functions are left blank.
I have exposed the mqtt controls using:
Code: Select all
on MQTT#Connected do
timerSet,1,60
Publish homie/%mac_int%/$homie,3.0
Publish homie/%mac_int%/$name,%sysname%
Publish homie/%mac_int%/$stats/interval,60
Publish homie/%mac_int%/$stats,uptime,signal,cpuload,freeheap
Publish homie/%mac_int%/$nodes,DHT,FAN
Publish homie/%mac_int%/DHT/$name,DHT22
Publish homie/%mac_int%/DHT/$properties,Temperature,Humidity
Publish homie/%mac_int%/DHT/Temperature/$name,Temperatur
Publish homie/%mac_int%/DHT/Temperature/$unit,°C
Publish homie/%mac_int%/DHT/Temperature/$datatype,float
Publish homie/%mac_int%/DHT/Humidity/$name,rel. Luftfeuchtigkeit
Publish homie/%mac_int%/DHT/Humidity/$unit,%rel.H
Publish homie/%mac_int%/DHT/Humidity/$datatype,float
Publish homie/%mac_int%/FAN/$name,FanSpeed
Publish homie/%mac_int%/FAN/$properties,FanSpeed
Publish homie/%mac_int%/FAN/FanSpeed/$name,Speed
Publish homie/%mac_int%/FAN/FanSpeed/$settable,true
Publish homie/%mac_int%/FAN/FanSpeed/$datatype,integer
Publish homie/%mac_int%/$state,ready
endon
and I am using the subscribed event:
Code: Select all
on FAN/FanSpeed do
PWM,13,%eventvalue1%,0,200
homieValueSet,1,1,%eventvalue1%
Publish homie/%mac_int%/FAN/FanSpeed/%eventvalue1%
endon
Is this what you have in mind?