Mqtt sensor not compatible?
Closed this issue · 5 comments
Can someone please confirm that the list-card will not be able to use a list from an mqtt sensor?
The card reads the entity's attributes as a dict and treats each key/value pair as an item. If you've got your items as a list of dicts, you can't set it directly on the entity attributes, and the card doesn't allow defining an attribute which contains the list of items.
Additionally, there's no way of using templates to convert lists to dicts, but since you're using node-red, you might have more options there.
@DarkFox has the right idea. Going to close this as not really an issue. Feel free to submit a PR for extended use cases
Just for the record, in case someone with the same issue stumbles over this thread, here's how I solved it: https://github.com/DarkFox/ha-config/blob/687791a/packages/integrations/weather.yaml#L123-L128
xkcd.com/979
Just for the record, in case someone with the same issue stumbles over this thread, here's how I solved it: https://github.com/DarkFox/ha-config/blob/687791a/packages/integrations/weather.yaml#L123-L128
Please forgive my ignorance, but can you elaborate a little as I'm not sure I understand. You solved the issue that I was having by replacing ' with " in the string that you published to an mqtt sensor?
It's because HA's string conversion outputs it with single quotes, which isn't valid JSON, so it won't get parsed by the mqtt sensor.