Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish GPIO settings with MQTT is not included in HA auto discovery #3302

Open
Dag0d opened this issue Oct 5, 2024 · 8 comments
Open

Publish GPIO settings with MQTT is not included in HA auto discovery #3302

Dag0d opened this issue Oct 5, 2024 · 8 comments
Labels
enhancement New feature or request Release16.0.0

Comments

@Dag0d
Copy link

Dag0d commented Oct 5, 2024

The Problem

When GPIO Pins are configured they are published to MQTT if "GPIO1 Enable MQTT" is checked this is as expected.
But it is not included in the HA auto discovery message.
Maybe there was a reason behind this decision, if so I´m happy to hear it.

Version

1.5.7 and 1.6.0 RC2

Logfile

I guess no need for a log file

Expected Behavior

No response

Screenshots

No response

Additional Context

No response

@Dag0d Dag0d added the bug Something isn't working label Oct 5, 2024
@caco3
Copy link
Collaborator

caco3 commented Oct 5, 2024

The reason simply is that I was not aware of it when I implemented the discovery topics.
If somebody wants to extend it, I am happy to test it, but don't currently have the time to extend it myself.

@caco3 caco3 added Release16.0.0 enhancement New feature or request labels Oct 6, 2024
@caco3
Copy link
Collaborator

caco3 commented Oct 17, 2024

@Dag0d I am happy to extend the discovery topics to reflect the control topics we have.
Currently there are 3 of them:

  • ctrl/flow_start
  • ctrl/set_prevalue
  • GPIO/GPIO{PinNumber}

They are already documented in https://jomjol.github.io/AI-on-the-edge-device-docs/MQTT-API/#control

How ever I struggle to get them working (make them show up in HA). I tried it like in https://community.home-assistant.io/t/add-entity-to-mqtt-device/540949/7 but nothing showed up in HA.
So if somebody is willing to provide the needed config topics, I will add it. if not, I will move it aside for now.

@caco3 caco3 removed the bug Something isn't working label Oct 17, 2024
@Slider0007
Copy link
Collaborator

Slider0007 commented Oct 18, 2024

@caco3: I only have it already implemented for flow start:

.configTopic = "flow_start",
.friendlyName = "Manual Cycle Start",
.icon = "timer-play-outline",
.deviceClass = "update",
.entityCategory = "config"

topicFull = "homeassistant/button/" + node_id + "/" + configTopic + "/config";

In HA:
image

@caco3
Copy link
Collaborator

caco3 commented Oct 18, 2024

@Slider0007 Nice. Can you prepare a branch with it? I then can check to extend it.

Other question:
Do you know why we need a payload here?

@Slider0007
Copy link
Collaborator

@Slider0007 Nice. Can you prepare a branch with it? I then can check to extend it.

Other question: Do you know why we need a payload here?

If I remember right, there is no specific reason. Maybe a small safety feature to not disturbing the cycle by mistake, but in the end only definition...

@caco3
Copy link
Collaborator

caco3 commented Oct 18, 2024

ok, then I will throw it out.
Reason is that i am not sure if HA supports a switch cmd with payload.
also, IIRC, if you trigger it while it is already running, nothing happens.

@Slider0007
Copy link
Collaborator

Slider0007 commented Oct 18, 2024

ok, then I will throw it out. Reason is that i am not sure if HA supports a switch cmd with payload.

I have it already implemented the same way (with payload) in my fork and the start trigger is working in home assistant. So there should be no limitation, but still could be removed.

@Slider0007
Copy link
Collaborator

@caco3: I prepared a branch with the possible changes for the flow start button discovery: https://github.com/jomjol/AI-on-the-edge-device/tree/extend-ha-discovery

It's not tested yet, though. Can be extended further...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Release16.0.0
Projects
None yet
Development

No branches or pull requests

3 participants