I just added a tasmota with SDM630 to my Home Assistant:
The mqtt integration recognized the entities:
Now my problem is that for example power is an array of 3 values:
I would like to be able to deal with them separately. I kind of understood I should use templating to be able to create an entity for each of those values
As far as I understand your sensor, the three numbers are the state of your sensor and not an attribute…
Do you have a view of the state/attributes of your entity ? Like these examples:
If the code is in the file “sensors.yaml”, than the first line (sensor) must be removed…
Can you give me the error code in home-assistant.log if the error persists…
2020-03-25 11:50:53 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.template]: invalid slug main_power_L1 (try main_power_l1) for dictionary value @ data['sensors']. Got OrderedDict([('main_power_L1', OrderedDict([('value_template', "{{ states('sensor.main_power_energy_power').split(';')[0] }}")]))]). (See /config/configuration.yaml, line 35). Please check the docs at https://www.home-assistant.io/integrations/template
In the future, please add images directly within the post (like you did in your latest posts) instead of some photo-sharing site with advertising, trackers, etc (like you did in your first few posts).
We want to help you but shouldn’t have to visit dubious sites we would normally not use. Thank you for your understanding.
Can you share with us how the sensor main_power_energe_power was created because I created one in my environment with 3 values but it is surrounded by () and not []… and the code I gave you is working in my environment…
Respectfully, that’s a clumsy way of extracting the values. It may work but I would not promote it as a “Solution” (i.e. users should avoid using this technique).
Happy it is working… as @123 is mentioning, it would have been better to get those values directly from MQTT … By the way to remove the first and the last character, you can also just replace [0] by [0][1:] and to drop the last character [2] by [2][:-1]