Hi, in my HA with evcc as addon, evcc sends a topic named evcc/site/gridEnergy to the HA internal mosquitto broker. I can see the correct values arriving in HA via HA addon MQTT explorer. And I can trigger an automation with it. So everything shoud be fine.
BUT: The received value is always interpreted as a giant integer, while evcc sends a payload e.g. 1234.56 what should be a string containing a float value.
The trace shows (for example):
MQTT Explorer is a highly recommended free program to use to verify what data is being received by your mqtt broker:
I can’t say for certain what the issue is, but my first attempt would have been without the encoding: '' line (just remove it entirely) and the template would be {{ trigger.payload | float }}
Although if you’re just copying this into an input number, why don’t you just create an mqtt sensor instead and get rid of the input number and the automation?
I tried a lot before (including remove encoding: '' and trying {{ trigger.payload | float }} ), but all this makes no difference.
Now I tried your idea and created an mqtt sensor, it shows 2.757e+07, which I think is the same problem.
Here the proof by MQTT Explorer, that the above is wrong: