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

Attributes not visible in Home Assistant #51

Open
allgrinder opened this issue Dec 15, 2024 · 16 comments
Open

Attributes not visible in Home Assistant #51

allgrinder opened this issue Dec 15, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@allgrinder
Copy link

Hey,
unfortunately, I can't retrieve the BUS-ID as described in the documentation, so I can't control the door via Home Assistant. What am I doing wrong?

Best regards,

grafik

@mrtnkhl
Copy link

mrtnkhl commented Dec 17, 2024

Hi @allgrinder,

Can you give a bit more details on what you did step by step? Did you see any BUS messages?

@allgrinder
Copy link
Author

Ah sorry, that was my mistake.
In the end, I simply activated and tested the video function or door opening on the indoor unit. Gdoor was integrated via MQTT...
I also received a corresponding entry in the logbook. Some of them are duplicated, but that’s not a big issue for now... I’ll look into that next.
According to the documentation: https://gdoor-org.github.io/documentation/homeassistant.html, the result in the logbook should look like this:

GDoor changed to {"action": "BUTTON_RING", "parameters": "0360", "source": "A286FD", "destination": "000000", "type": "OUTDOOR", "busdata": "011011A286FD0360A04A"}

Apparently, the parameter is crucial... but I’m not receiving any parameter.

Also, the examples for typical use cases are not working either... I keep getting the message "shell command not found," which is surprising to me.

@DaSchaef
Copy link
Contributor

I can not comment on HA (I'm a OpenHab user ^^).

Apparently, the parameter is crucial... but I’m not receiving any parameter.

You received them :-)

{"action": "BUTTON_RING", "parameters": "0360", "source": "A286FD", "destination": "000000", "type": "OUTDOOR", "busdata": "011011A286FD0360A04A"}

"parameters" = "0360"

The parameters field has a different meaning for different bus actions.
For ring button pressed ("BUTTON_RING"), it mostly codes which button on the outdoor station was pressed, if there are e.g. multiple stations in the house. Therefore it is important for you, to use the value as filter, to not react to all buttons :)

@DaSchaef
Copy link
Contributor

If you do not receive anything, you may want to try http://mqtt-explorer.com/ to "listen" to the GDoor ---> HomeAssistent communication. So we can avoid that HA is hiding the GDoor message from you somehow.

@allgrinder
Copy link
Author

No, that was the example from the GitHub page. I didn’t receive anything – just 0000.
IMG_0337

@DaSchaef
Copy link
Contributor

This may indicate that you do not receive any events? The "IDLE" is from GDoor itself and only a kind of keepalive ("I'm here") packet.

You should receive events, when you do something with the bus e.g. press the door button on the outdoor station. For testing, you can also use the light button on the indoor station. This is often easier to reach ;)

If you do not receive any bus message, we need to investigate further:

  • Is GDoor connected to the bus?
  • Can you listen to the raw MQTT messages (e.g. http://mqtt-explorer.com/) so that we can take HomeAssistant out of the possible error sources
  • You should see MQTT messages on the topic, also set up in HA in the MQTT Explorer.

@allgrinder
Copy link
Author

Yes, I do get all the events displayed correctly. But they just come without parameters.
IMG_0340

@DaSchaef
Copy link
Contributor

Hm, I'm no HA user. Can you click on it and get more details, (meaning the raw message)?
I think HA is hiding it from you :)

Otherwise we need another HA user here to support a bit - but seems solvable 👍

@allgrinder
Copy link
Author

All good! Thanks for your support. My post with the screenshot at 17:14 shows the details of a Button Ring. Once I’m home and have some time, I’ll install the Explorer.

@DaSchaef
Copy link
Contributor

The screenshot at 17:14 is an IDLE message, no BUTTON_RING ? This is why the parameter is empty in this mentioned image :)

@allgrinder
Copy link
Author

Yes, that confuses me as well… I click on the corresponding event, and it only shows Idle.

@allgrinder
Copy link
Author

It's really strange – MQTT Explorer shows the parameter, and Home Assistant also displays the various statuses. But the bus adapter's log continuously shows 'Idle' or doesn't indicate that another status briefly appeared.

grafik

grafik

@allgrinder
Copy link
Author

The ticket can be closed. I can control the door via MQTT and receive a notification when the doorbell rings. That was my goal, and it works! Thank you for your help!

@jschroeter
Copy link
Collaborator

Did you check the Logbook in HA? Its enabled by default and usually doesn’t need to be configured. There you should see all events including details.
In the History view you’ll mostly only see the details of the last event, which is always BUS_IDLE.

@jschroeter
Copy link
Collaborator

jschroeter commented Dec 28, 2024

Reopening this as we indeed have 2 problems here - I didn't notice them so far as I was mainly using the serial integration:

  1. due to this line, HA only shows the action in the Logbook. Unfortunately HA only allows to see the JSON attributes for the latest state, which is always BUS_IDLE (as we send this action after every other action) and therefore you can't see e.g. the parameters of an relevant action.
  1. quite frequently HA reports that the sensor is unavailable/unknown and actions are missing on the HA sensor (but they do appear when listening to the MQTT topic directly). I'm pretty sure this happens because HA only allows 255 characters for a value and we often exceed this.

Suggestions:

  • to fix 1),

    • A) we change mqtt_helper.cpp#L132 to "value_template": "{{ value }}" which would display the whole JSON as string. Works but looks a bit clunky, especially in the history view.
    • B) or to "value_template": "{{ value_json.action }} {{ value_json.source }} {{ value_json.destination }} {{ value_json.parameters }}". Looks cleaner but needs explanation what these values actually are. Nice side effect: since the event id is not included, equal actions are shown with the same color code.
    • C) we drop the BUS_IDLE action again, I personally still don't like it and so far don't have a use case for it as discussed before, but I think some find it useful.
  • to fix 2)

    • D) we remove the raw attribute as it duplicates busdata anyway. By that we should stay under 255 chars.
    • E) we move it and maybe other debug-related attributes (valid, newly added busvoltage) to an own MQTT topic, e.g. gdoor/debug or gdoor/rx_debug

Any opinions? I'd vote for C) and/or B) + E).

@jschroeter jschroeter reopened this Dec 28, 2024
@jschroeter jschroeter changed the title No BusID via Hassio Attributes not visible in Home Assistant Dec 28, 2024
@jschroeter jschroeter added the bug Something isn't working label Dec 28, 2024
@allgrinder
Copy link
Author

Yes, @jschroeter is right... it is indeed a bit confusing. But once you're aware of the peculiarity, you can deal with it. I can control the door, receive signals, and perform actions... so I'm very satisfied :)

But C is probably pragmatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants