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

Depreciated warnings from home-assistant #1440

Closed
inverse opened this issue Dec 19, 2018 · 10 comments
Closed

Depreciated warnings from home-assistant #1440

inverse opened this issue Dec 19, 2018 · 10 comments

Comments

@inverse
Copy link
Contributor

inverse commented Dec 19, 2018

In the last major update of home-assistant I noticed the following warnings in the logs

"platform": "mqtt" is deprecated, replace with "schema":"basic"

From researching the issue I realise It's to do with the mqtt message with auto-discovery that will need to be adjusted.

Having no expeirence with this code base would I be right in the assumption that it involves changing this line?

https://github.com/xoseperez/espurna/blob/dev/code/espurna/homeassistant.ino#L82

From:

    config.set("platform", "mqtt");

To:

    config.set("schema", "basic");
@xoseperez xoseperez added this to the 1.13.5 milestone Dec 19, 2018
@mcspr
Copy link
Collaborator

mcspr commented Dec 20, 2018 via email

@inverse
Copy link
Contributor Author

inverse commented Dec 20, 2018

@mcspr thanks for adding more context 👍

I just reached out to the HA community and they are moving super fast and don't really time line these things out as when things will be phased out. Hopefully once they hit 1.0 they will stablise but I dont see that happening any time soon ;)

@xoseperez xoseperez modified the milestones: 1.13.5, 1.13.4 Dec 20, 2018
@xoseperez
Copy link
Owner

The question here is how fast people are upgrading their hass installations. Because replacing it will result in it stopping working for people with older versions. Maybe we can add both settings and remove the platform setting in a few months?

@inverse
Copy link
Contributor Author

inverse commented Dec 21, 2018

@xoseperez that's a very valid point. I think generally people move with the releases but supporting both would be a good solution for a while and will cover people like me who keep up and when they do finally remove the feature not be broken. What do you think?

@peterhoeg
Copy link
Contributor

I have filed a feature request with HA for having it publish either its own version or an API version via MQTT. That would allow espurna to detect the format to use.

@peterhoeg
Copy link
Contributor

That is assuming @xoseperez wants to go in that direction of course.

@mcspr
Copy link
Collaborator

mcspr commented Dec 28, 2018

@peterhoeg Have you posted the issue to the home-assistant/home-assistant about mqtt version? I would not rely on versions for this, but it might be nice to display that ESPurna device found HA presence.

"schema" / "platform" can also be avoided altogether as it falls back to the basic mqtt method (on / off / state topics) and implicitly passes "platform": "mqtt" to the configurator.
There is no json lights support -> no need to specify it right now. And no warning.
Future version must use "schema": "json" (which is from config spec, not discovery specific) to use json payloads

@peterhoeg
Copy link
Contributor

@mcspr, I did on discourse as that's where they prefer feature requests: https://community.home-assistant.io/t/publish-ha-version-to-mqtt/86694

I has not received any replies though.

@xoseperez xoseperez modified the milestones: 1.13.4, 1.13.5 Jan 4, 2019
@xoseperez xoseperez modified the milestones: 1.13.5, 1.13.6 Feb 26, 2019
@stale
Copy link

stale bot commented Apr 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 27, 2019
@stale
Copy link

stale bot commented May 4, 2019

This issue will be auto-closed because there hasn't been any activity for two months. Feel free to open a new one if you still experience this problem.

@stale stale bot closed this as completed May 4, 2019
mcspr added a commit to mcspr/espurna that referenced this issue Sep 2, 2019
mcspr added a commit to mcspr/espurna that referenced this issue Sep 2, 2019
mcspr added a commit that referenced this issue Sep 3, 2019
- remove "platform" key, see #1440. this implicitly sets schema to "basic". pending some other clean-up regarding json and mqtt queueing, other schema can be added down the line 
- updated ws module queue elem to capture callbacks list, allows to pass more than one callback (for example, when they are generated on the fly as lambdas, see ha wsPost usage)
- modified method to send ha config to use global ws queue, fix #1762 problem with empty topics and ensure json allocation is consistent.
- use existing defines to set mqtt payload options. amend #1085, #1188, #1883 to use the set payload value. drop HOMEASSISTANT_PAYLOAD... defines. 
- update MQTT_STATUS_ONLINE/OFFLINE and RELAY_MQTT_ON/OFF with runtime configuration
- filter payload strings so that the resulting yaml value is not interpreted as bool (python True, False)
- helper method for settings to streamline string values manipulation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants