Skip to content

Read entity state from MQTT topics #73

Open
@unixorn

Description

@unixorn

Per @mion00's suggestion in #18, we should store state of our created entities in an MQTT topic.

I have an idea: what if we use the broker as our "state storage"? Since all the entities are strictly correlated with a config message inside the HA topic tree, and those are retained, we could read them on startup, and for each device in the "device" field we create this "virtual device" that the user interacts with.
It might seems a bit cumbersome, but this way we don't depend on a local state file and in addition any device deleted by the user in HA will not show up for us, avoiding sync problems.

The more I think about it, the more I like this idea. Being able to persist a current state in our entities should make the command line tools less awkward.

Edit: Make this to read the config topic and load the state(s) it points at.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions