Mqtt to entity

So I have been trying to solve an issue. I am currently running all the latest updates on HA, and several tuya wifi temp humid sensors. They work well and are integrated with the tuya integration. However the numbers for all of them are within 1F or 1% humidity of each other but they are off from a known calibrated sensor in my home. So in an effort to calibrate the tuya sensors to my known device I am hitting a wall.

I’ve tried node red using a poll state then function and publish to mqtt. Which works, but I can’t figure out how to take the published topic and state in mqtt to the frontend or overview.

Using mqtt explorer I can clearly see the new data being updated and published for the adjusted sensor readings. How the heck do I get it back to a sensor so I can show it on the overview or dashboard and automations? Here is a screen shot of the node red flow and mqtt explorer showing the data.


Hi smaj100,

Make an MQTT sensor like you did in NR.

1 Like

thank you sir, i’ve been beating my head on the desk for hours the past couple of days trying to figure out how to go back from mqtt to entity. I’m assuming there is a way to do all of this in node red since thats where i did the calculations and pulled the initial state data from.

To create an entity from NR first install the NR companion in hacs. Once that is installed drag a blue sensor node to the workspace. Open the setting panel and hit the + sign next to entity config.

image

There enter a name, friendly name, and choose a device class and a state class. Device and state class is optional and can be changed latter. Click the add button. You will be back to the sensor node settings. Where it says state

image

Enter the message path to the primary state of the sensor. To add attributes, click the + attribute button

image

This will create an attribute named my_second_value and will display the value from msg.payload.data.level