Coder Social home page Coder Social logo

Mqtt sensor not compatible? about list-card HOT 5 CLOSED

iantrich avatar iantrich commented on August 14, 2024
Mqtt sensor not compatible?

from list-card.

Comments (5)

DarkFox avatar DarkFox commented on August 14, 2024 1

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.

from list-card.

DarkFox avatar DarkFox commented on August 14, 2024 1

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

from list-card.

iantrich avatar iantrich commented on August 14, 2024

@DarkFox has the right idea. Going to close this as not really an issue. Feel free to submit a PR for extended use cases

from list-card.

PlayedIn avatar PlayedIn commented on August 14, 2024

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?

from list-card.

DarkFox avatar DarkFox commented on August 14, 2024

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.

from list-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.