• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT subscribe to a weather station?
#1
I want to subscribe to the pilight mqtt broker to get at temperature, humidity and battery status of a weather station (tfa), e.g. with the topic "pilight/device/weather1". According to the MQTT API docu, I have to put the appropriate device "weather1" into the config.json, but can not find any info on how to do that, only examples for switches, dimmers and the like.

Background: I originally configurated a pilight adhoc network, but the connection from the client instance to the master instance was always lost within a short time. My pilight version on both raspi 3 currently is v8.1.5-nightly-45c64b39. So, my solution to this dilemma is a MQTT bridge, and thus the need to subscribe as described above.
 
Reply
#2
What you can do is adjusting the /usr/local/lib/pilight/hardware/mqtt.lua and let the mqtt.connect("127.0.0.1", 1883); line point to the right address.
 
Reply
#3
(04-07-2020, 05:13 PM)curlymo Wrote: What you can do is adjusting the /usr/local/lib/pilight/hardware/mqtt.lua and let the mqtt.connect("127.0.0.1", 1883); line point to the right address.

It's not that I can't connect to the broker. My problem is that I do not know how to put a device like the digoo sensor (protocol: tfa) into the config.json.
By the way, though pilight-receive reports a lot of devices, mainly the neighbours, but also my weather station, the program MQTT.fx does not show any dvices when I subscribe to "#". Only pilight/sys/+ is shown.
 
Reply
#4
You somehow have to translate the MQTT info to e.g. a generic_weather yourself.

The TFA protocol only works with 433.92Mhz hardware modules.
 
Reply
#5
(04-07-2020, 09:14 PM)curlymo Wrote: You somehow have to translate the MQTT info to e.g. a generic_weather yourself.

The TFA protocol only works with 433.92Mhz hardware modules.

The digoo sensor is a 433.92MHz hardware module!

I found out that I can simply copy the device entry from the tfa protocol docu. It does not matter that there are some wild values for temperature and so on. Only the id had to be adjusted. Unfortunately, the id can not be omitted without provoking an error, The problem here is that this id changes with every battery change. Crying

Sorry to have bothered you.
 
Reply
#6
Yes, I know tfa is a 433.92 device. But you want to adjust it's values by using mqtt. As I said, that not possible. Only a 433.92 hardware module can do that, of you have to mimic such module yourself by adjusting the mqtt hardware module.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  MQTT external Broker (not local) configuration nicky 3 170 06-02-2020, 05:00 PM
Last Post: curlymo
  MQTT cannot be disabled on nightly image ayeyebrazov 5 306 05-01-2020, 03:11 PM
Last Post: ayeyebrazov
  MQTT subscribe/publish in pilight? cactli 9 4,315 01-02-2018, 05:05 PM
Last Post: xelarep
  Weather Underground Protocol issue troccolo 13 5,993 03-28-2015, 03:01 PM
Last Post: troccolo
  Need some help with (Generic) Weather protocol TheWheel 7 5,087 03-14-2014, 06:05 PM
Last Post: TheWheel

Forum Jump:


Browsing: 1 Guest(s)