-
Notifications
You must be signed in to change notification settings - Fork 6
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
Redesign AppInfo: Update sensor #96
base: main
Are you sure you want to change the base?
Conversation
@infeeeee Current idea is to find a good way to implement an Update entity of Home assistant out of a Sensor of IoTuring, which could be used at start in IoTuring, but later also to check possible updates of other programs if anyone will be interested in it |
Current idea:
The problem is that each entity data has its own key and if I have the HomeAssistant warehouse that has to map these 4 data in one Update Entity in Hass, it doesn't know which data is what (e.g. doesn't know current version sensor needs to go in the configuration as the current version). Two ideas:
Example of entities.yaml for choice 2:
What do you think @infeeeee ? I don't know if I wrote it down in an understable way |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yeah sorry let me rewrite it. In order to have the HassUpdate entity, we need to specify in the configuration we send via MQTT to Hass:
In order to get this behavior, I need my IoTuring entity to have two sensors that send the current and latest version and a command to start the installation.
The problem is that the Hass WH doesn't know which of the sensors of my entity is the one with the current version and the one with the latest version. In this way when we type in the YAML that we want to configure an Update entity in Hass, then we place in the MQTT configurations the topics of the sensors I can correctly identify by using the keys I have in entities.yaml e.g.
I hope it's better now; with Update I was not talking of the entities update interval |
Ah, ok , I understand now, I didn't know about the MQTT Update entity. Basically it's an I would do it this way:
IoTuringUpdate:
icon: mdi:update
custom_type: update
secondary_topic: latest_version_topic
|
But this would be a problem if we would like to use the MQTT update entity without the command to trigger the update, since in IoTuring the command would become necessary isn't it ? |
Good point, then the other way: create a sensor with 2 topics. Actually this is the same way as ExtraAttributes work, maybe ExtraAttribute workflow could be tweaked, so they can publish to a custom topic, and in plaintext not in json. Or create some dummy HomeAssistantCommand which doesn't have a command topic, and connect the 2 sensors to that. |
Well I prefer the Command way but I have to figure it out the best approach, thank you |
@infeeeee I can use a simple sensor connected to a command, then I define the topic of latest version to be the extra attributes of current version and set the value template to extract the value from the extra attributes json |
Need to come back to previous idea: having extra attributes
|
HAss supports the Update entity discovery payload without command topic so to not show the "install" button. However without the Install button, the update doesn't show up in the available updates page. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange it doesn't happen to me |
It cuts after exactly 255 characters, it's documented here: https://www.home-assistant.io/integrations/update.mqtt/#release_summary
But this should be generated from the changelog in the future, and the It's this line:
|
Okay thanks I remove the description from there |
Wait, this secondary sensor not even needed. I read the docs again, you can just publish a json to the
At the bottom of the page: https://www.home-assistant.io/integrations/update.mqtt/#examples |
Yes I know but in that way we would have lost the latest version information in other warehouses. Also we would have needed to add to the discovery payload another attibute with the same topic as the state_topic: since the state_topic is dynamically computed and can't be set neither in entities.yaml or in AppInfo custom payload method, we would have had to do some other changes in the Hass WH. WIth secondary sensor now we are able to support also other types of HomeAssistant entities that need additional attributes topic in the payload edit: yes it's right we could have directly avoided the latest version topic. |
@infeeeee what do you think ? I'd leave it as is to make it available to other WH too |
Both ways have pros and cons: Pros of this workflow:
Cons of this workflow:
What should be changed if we send everything as a json/dict from a single sensor:
Comparing pros and cons, I think sending everything in a json in a single sensor should be better solution. |
I was thinking about this, and I found more pros for this workflow: Maybe this multi sensor workflow would be useful elsewhere. MQTT Cover can send position and tilt values in a separate topics similarly: https://www.home-assistant.io/integrations/cover.mqtt/#position_topic But this needs 2 more sensors. Maybe the ExtraAttributes could become a separate sensor as well, converted to ExtraAttribute json only in HA WH, their data could be visible in other WHs, as ExtraAtrributes now only visible in HA. To solve the So now I think this workflow would be better :) |
I like this change of idea :) |
@infeeeee How to place the release summary in just 255 chars ? I'd leave for sure the NO_REMOTE_INSTALL_AVAILABLE_MSG and then the space is really small |
Another thing, currently the custom payload is set at command register and not updated later |
Currently it's trimmed to place "..." when additional release summary entries don't fit in 255 chars |
Related to #92
AppInfo now has
In HomeAssistant is shown as Update entity which notifies the user when an update is available
TODO
Find a way to remove the command_topic if no Install method is implemented