-
Notifications
You must be signed in to change notification settings - Fork 7
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
Integration does not work after upgrade to 0.9 #50
Comments
Could you check if you're on the latest firmware of the Button+ device? You can check by going to the IP address. |
Yes, I'm on firmware 1.11 |
@P-Storm seems the configuration json doesn't always have a "topics" child key in the json? |
On the I think it is also a good case to check if key exist, if not create an empty list/array of it. |
Sure, here’s my config: {
"info": {
"id": "btn_462b80",
"mac": "F4:12:xx:xx:xx:xx",
"ipaddress": "192.168.xxx.xxx",
"firmware": "1.11",
"largedisplay": 0,
"connectors": [
{
"id": 0,
"type": 2
},
{
"id": 1,
"type": 1
},
{
"id": 2,
"type": 1
},
{
"id": 3,
"type": 1
}
],
"sensors": [
{
"sensorid": 1,
"description": "Sensirion STS35 Temperature Sensor"
}
]
},
"core": {
"name": "btn_462b80",
"location": "Woonkamer",
"autobackup": true,
"brightnesslargedisplay": 60,
"brightnessminidisplay": 60,
"ledcolorfront": 0,
"ledcolorwall": 0,
"color": 6603878,
"statusbar": 0,
"topics": []
},
"mqttbuttons": [
{
"id": 0,
"label": "Btn 0",
"toplabel": "Label",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/0/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/0/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/0/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 1,
"label": "Btn 1",
"toplabel": "Label",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/1/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/1/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/1/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 2,
"label": "Woonkamer",
"toplabel": "Verlichting",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/2/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/light/status",
"payload": "on",
"eventtype": 10
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/2/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/2/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 3,
"label": "Eetkamer",
"toplabel": "Verlichting",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/3/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "buttonha",
"topic": "button.plus/eetkamer/light/status",
"payload": "on",
"eventtype": 10
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/3/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/3/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 4,
"label": "Open",
"toplabel": "Gordijn voor",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/4/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/gordijn/status",
"payload": "on",
"eventtype": 10
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/4/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/4/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 5,
"label": "Keuken",
"toplabel": "Verlichting",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/5/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "buttonha",
"topic": "button.plus/keuken/light/status",
"payload": "on",
"eventtype": 10
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/5/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/5/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 6,
"label": "",
"toplabel": "",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/6/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/6/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/6/top_label",
"payload": "",
"eventtype": 12
}
]
},
{
"id": 7,
"label": "66 km",
"toplabel": "Auto laden",
"ledcolorfront": 0,
"ledcolorwall": 0,
"longdelay": 75,
"longrepeat": 15,
"topics": [
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/7/click",
"payload": "press",
"eventtype": 0
},
{
"brokerid": "buttonha",
"topic": "button.plus/notification/auto/range",
"payload": "on",
"eventtype": 9
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/7/label",
"payload": "",
"eventtype": 11
},
{
"brokerid": "ha-button-plus",
"topic": "buttonplus/btn_462b80/button/7/top_label",
"payload": "",
"eventtype": 12
}
]
}
],
"mqttdisplays": [
{
"x": 0,
"y": 0,
"fontsize": 4,
"align": 1,
"width": 50,
"round": 0,
"label": "Nijmegen",
"unit": "",
"page": 0,
"topics": [
{
"brokerid": "buttonplus",
"topic": "system/datetime/amsterdam",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 0,
"y": 40,
"fontsize": 2,
"align": 1,
"width": 20,
"round": 1,
"label": "Kamer",
"unit": "°C",
"page": 0,
"topics": [
{
"brokerid": "buttonplus",
"topic": "button/btn_462b80/temperature",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 30,
"y": 40,
"fontsize": 2,
"align": 1,
"width": 20,
"round": 1,
"label": "Buiten",
"unit": "°C",
"page": 0,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/temperature/outside",
"payload": "{state}",
"eventtype": 15
}
]
},
{
"x": 60,
"y": 0,
"fontsize": 2,
"align": 1,
"width": 40,
"round": 2,
"label": "Stroomprijs",
"unit": "EUR/kWh",
"page": 0,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/energy/current_price",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 0,
"y": 65,
"fontsize": 1,
"align": 1,
"width": 100,
"round": 0,
"label": "Sonos - now playing:",
"unit": "",
"page": 0,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/speakers/title",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 0,
"y": 0,
"fontsize": 1,
"align": 1,
"width": 95,
"round": 0,
"label": "Energie details",
"unit": "",
"page": 1,
"topics": []
},
{
"x": 0,
"y": 25,
"fontsize": 2,
"align": 1,
"width": 40,
"round": 2,
"label": "Stroomverbruik",
"unit": "kWh",
"page": 1,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/energy/accumulated_consumption",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 45,
"y": 25,
"fontsize": 2,
"align": 1,
"width": 40,
"round": 2,
"label": "Zonnepanelen",
"unit": "kWh",
"page": 1,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/energy/accumulated_production",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 0,
"y": 50,
"fontsize": 2,
"align": 1,
"width": 40,
"round": 0,
"label": "Waterverbruik",
"unit": "L",
"page": 1,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/energy/accumulated_water",
"payload": "",
"eventtype": 15
}
]
},
{
"x": 45,
"y": 50,
"fontsize": 2,
"align": 1,
"width": 40,
"round": 3,
"label": "Warmtenet",
"unit": "GJ",
"page": 1,
"topics": [
{
"brokerid": "buttonha",
"topic": "button.plus/woonkamer/energy/accumulated_warmtenet",
"payload": "",
"eventtype": 15
}
]
}
],
"mqttbrokers": [
{
"brokerid": "buttonha",
"url": "mqtt://192.168.xxx.xxx",
"port": 1883,
"wsport": 0,
"username": "xxx",
"password": "xxx"
},
{
"brokerid": "buttonplus",
"url": "mqtt://mqtt.button.plus",
"port": 0,
"wsport": 0,
"username": "",
"password": ""
},
{
"brokerid": "ha-button-plus",
"url": "mqtt://192.168.xxx.xxx/",
"port": 1883,
"wsport": 9001,
"username": "xxx",
"password": "xxx"
}
],
"mqttsensors": [
{
"sensorid": 1,
"interval": 10,
"topic": {
"brokerid": "buttonplus",
"topic": "button/btn_462b80/temperature",
"payload": "",
"eventtype": 18
}
}
]
} |
Fixing #50 - topics not there/empty
@Al3xand3R360 Please try out the latest version (0.0.10) of the integration. You can re-open this issue if this has not been fixed. |
It does not seem to work yet. With version 0.10 the integration does not load after restart. Logger: homeassistant.loader
and
are logged after restart. |
@koenhendriks I can’t seem to re-open this issue myself. Would you mind te-opening it? |
For me it's now impossible to start the config flow in 0.10.
Looks like it's failing on the same |
Looks like something weird is happened with merging, let's check. |
Well, my change didn't include, dunno how that could be, but gonna test this out before submitting another PR. Sorry about this! from config.custom_components.button_plus.button_plus_api.event_type import EventType |
And also tested on my non-dev HA instance. Looks like this fixes it. |
Should add some linter for python to avoid missing imports and such. The PR to fix the event types has been merged. I'll keep this issue open for now to ensure any fixes. |
Released v0.0.11 |
Thanks for the quick response guys! But still no luck, sorry... After updating and restart the following stacktrace is logged: Logger: homeassistant.setup
|
Don't know if it helps, but I'm updating from version 0.0.8 straight to 0.0.11 |
The |
The last part of the stacktrace is pointing to our code: button_plus.button_plus_api.local_api_client import LocalApiClient Sounds like a way forward. Also big confusion why I don't have this problem with the code on my instance. |
@Al3xand3R360 Could you trie manually deleting the the entire integration (custom_component) and also removing the entries from the I think your setup got corrupted a bit... |
I also tried a direct upgrade from 0.0.8 to 0.0.11, same error: |
I (manually) changed lines 6/7/8 in buttonplushub.py from
to
with these changes to v0.0.11, I got rid off the errors and the integration starts normally - and I do see the devices in the integration overview. I do get an error message, as follows:
Sorry for putting this all in a comment message, will have to learn how to use git commands. |
@P-Storm seems like you might need to use relative mapping in the imports? |
Same issue here, I upgraded from version 0.9 and now get this error: Logger: homeassistant.setup Setup failed for custom integration 'button_plus': Unable to import component: No module named 'config.custom_components' |
Sounds like you're right, I didn't look that big into the package mapping of python. But this looks like it is a part of the problem indeed. Will look into the code where this is a problem. |
The module importing I'm fixing. The last error you reported, it seems that your Button+ firmware is lower than version So @wimjanse please double check if you have the latest firmware version. |
It seems that the auto generate does include the |
@P-Storm |
Can you share your /config? I didn't have the variable defined, and have to check what is going wrong in the check itself. The error it throws is that the variable was not defined, I have also added this in the pull request #54. (sorry if I have already your config, but best way to reproduce these errors is the current config) |
Herewith the configs of both B+'s
and
|
Don't know if that went alright with the triple `, so here without: |
I have downloaded the files. And will look when I can work on them :) |
the "min_version" issue is (imho) not related to the config file. Python complaints about a "not defined" variable. min_version is defined in config_flow.py, but neither config_flow in general nor min_version in particular is imported in number.py . Hope this solves the issue. |
Maybe I explained it wrong. The min_version was a variable that I was forgetting to include. See the changes on this PR:
|
@wimjanse @roodbaard80 @Al3xand3R360 sorry for the notification, but the newest release is available: https://github.com/koenhendriks/ha-button-plus/releases/tag/0.0.12 . Ofcourse, it can have errors, but it fixes as far as I know the mentioned items. |
Just upgrade from 0.9 to 0.12 and I can confirm that the issue is solved for me. |
if 1 more (@wimjanse or @Al3xand3R360) can confirm this solves the issue I'll close this. |
I had v0.08 running, removed both devices from the Button+ integration, which then also removed the integration itself. Installed v0.12 and (manually) added both B+'s, everything looks ok, issues are gone. (I did get same warning as @roodbaard80 , will mentioned that in his separate issue. For me, this issue can be closed. |
Closing this as of PR #54 |
After updating integration to version 0.9 Button+ integration stops working.
I use HA2024.4.2
Logger: homeassistant.config_entries
Source: config_entries.py:504
First occurred: 16:15:15 (1 occurrences)
Last logged: 16:15:15
The text was updated successfully, but these errors were encountered: