Very basic question about sending data to HomeAssistant

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Very basic question about sending data to HomeAssistant

#1 Post by mackowiakp » 06 Apr 2024, 01:46

The temperature and humidity sensor gives irrational readings such as 350C or 220% once every few hundred readings.
To eliminate these incorrect readings, I have a rule that check it and sends only correct data to Domoticz via HTTP using the command:

Code: Select all

SendToHTTP,192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=59&nvalue=0&svalue=[HTU21D#Temperature];[HTU21D#Humidity];[INT#1
I would also like to send this data to HomeAssistant via MQTT.
If data is sent using the sensor driver - everything is fine. This means that the controller configuration in ESP and HomeAssistant configuration are OK.
However, if I want to send it using the command in the rule, the data is not displayed. Command below:

Code: Select all

Publish %sysname%/HTU21D/Temperature/[HTU21D#Temperature]
The MQTT broker shows such communication in case of correct operation with enable HomeAssistant controller in the sensor driver:

Code: Select all

1712360414: Received PUBLISH from Meteo_1_1 (d0, q0, r0, m0, 'Meteo_1/HTU21D/Temperature', ... (5 bytes))
1712360414: Sending PUBLISH to 5pLSdtrl8B6Rb6RBwL7oyh (d0, q0, r0, m0, 'Meteo_1/HTU21D/Temperature', ... (5 bytes))
1712360414: Sending PUBLISH to Meteo_1_1 (d0, q0, r0, m0, 'Meteo_1/HTU21D/Temperature', ... (5 bytes))
And these are the logs from the MQTT broker when the command "Publish" was sent from the "Tools" menu:

Code: Select all

1712360278: Received PUBLISH from Meteo_1_1 (d0, q0, r0, m0, 'Meteo_1/HTU21D/Temperature/13.20', ... (0 bytes))
1712360278: Sending PUBLISH to Meteo_1_1 (d0, q0, r0, m0, 'Meteo_1/HTU21D/Temperature/13.20', ... (0 bytes))
So what should the correct Publish syntax be?

User avatar
Ath
Normal user
Posts: 3531
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Very basic question about sending data to HomeAssistant

#2 Post by Ath » 06 Apr 2024, 10:11

It looks like the last slash character in your Publish command should be a comma... :?
/Ton (PayPal.me)

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Very basic question about sending data to HomeAssistant

#3 Post by mackowiakp » 06 Apr 2024, 10:15

Upss - SOLVED !!!
Just syntax error. Should be without slash like this:

Code: Select all

Publish %sysname%/HTU21D/Temperature [HTU21D#Temperature]

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests