#devs_add-ons-archived
1 messages · Page 6 of 1
I've been doing some work with the Home Connect integration and I've noticed that the API returns an inverted door state for my fridge and freezer 🙂
Given that it's possible they could fix this one day, I guess we'd prefer not to fix their error in our integration, correct?
I have an add-on with a few network/security considerations (WebRTC), curious for opinions on how to configure it. There's an HTTP endpoint with a web UI, an HTTP Rest API that has basic auth at the moment, I'm wondering if maybe it should keep the APIs/web UI without access but behind home assistant ingress rather than using its own basic auth. does that right right?
(it also may need host network access anyway for participating in webrtc, but i'm not sure yet. but then i'd love to keep the API ports internal)
is that what ingress_port of 0 does, effectively?
It generate a unique system port that you can read after the add-on start and listen on the hassio gateway for the supervisor
bashio::addon.ingress_port will return the port which you need to listen on
solved by myself ... I have two app (tuya and smart life) seems impossible to add device from the two app also linking the app account. Just moved all devices to smart life (or the other but all the device in only one app)
Hello, I am struggling with creating my first addon: When I am trying to run docker run ... -v "/root/addons/myaddon:/data" I am getting message docker: Error response from daemon: error while creating mount source path '/root/addons/myaddon': mkdir /root/addons: read-only file system I am issuing the command over the SSH dirrectly on my HASSIO OS raspi
Is there any way to specify some permanent storage for the container runned by my addon? (the service I am dockerizing needs one persistent file to store it's configuration and I am not sure how to express that in config.yaml of the addon)
Does that mean you don't have permission to /root/addons on your rpi? It seems like thats docker give you the error message before the add-on starts if i understand right
/data are all time persistent in our add-on
PR that allow to change the path inside the add-on as config option would be allowed
the path on the host is still managed by supervisor
would anybody be interested in glancing at this addon I have cleaned up , to point out any glaring errors? https://github.com/habuild/hassio-addons Also if someone could suggest how I get log file from /data/addon/sbfspot/log into the addon log that would be helpful.
Hello all,
I'm trying to change mariaDB addon data location to /media/Data/databases.
I cloned mariaDB addon to my private github repo and tried to change mariadb-server.cnf # Persistent storage locationdatadir=/data/databases to # Persistent storage locationdatadir=/media/Data/databases and run file MARIADB_DATA=/data/databases to MARIADB_DATA=/media/Data/databases
However, after applying those changes mariaDB data is still stored in default location. Any ideas why?
I uninstalled addon and tried to install it again after applying these changes, but addon still stores data in the same default location
Guys, I don't know if this is the correct channel to ask, but I think it's the one that matches the closest. I want to use the awesome home-assistant-language server that is embedded in te vscode-home-assistant plugin for neovim. Does anyone have a clue on how to set it up? I've been browsing through the source code for a while now, but can't see a simple way on how to start the server. https://github.com/keesschollaart81/vscode-home-assistant
Hi, for my add-on I needed to tweak a npm-module, now I want to copy the module's folder to the /data persistent storage folder of the addon in order to load it from there in my NodeJS based addon.
I'm not really knowledgable about the copy commands in the DOCKERFILE. What command should I use to achieve this?
Or do I need to do this another way?
so you are not mounting the folder correct? you just want to copy it into the container?
if so use COPY
The docker filesystem is a bit of a black box to me, don't really understand how it works. How would I go about mounting the folder?
I had my altered npm module in /share/moduleFolder while developing so far and loaded it in my script by referring to that folder. But it seemed tidier to have the folder inside the container. So in my dockerfile i now have COPY moduleFolder data/moduleFolder and then in my script i refer to data/moduleFolder. But this doesn't work.
Do you have a GitHub repo so I can take a closer look at it
here you go: https://github.com/kdw2060/hassio-addons/tree/master/hass-addon-calendar
Thanks for having a look.
The error must be with the copy-command in the docker-file or a missing copy command in run.sh.
When running the addon you get an error message from NodeJS telling you it can't find the /data/ics-to-json-extended' module (btw, ignore the fact that the original unmodified version of that package is still in the dependencies list in package.json)
One of the COPY statements is missing a destination
I need to add a point or a slash somewhere maybe? All 4 copy commands already have a source and destination. Have been experimenting with variants without success.
It looks like you have a source but not a destination. I will be able to have a better look at it when I get home
Line 14
Is it possible you forgot a space?
There is a space and src + dest on line 14. What i'm not sure about beside the points and slashes is also if that /data folder I copy to here is actually the persistent data folder that I write files to from within the script. I'll add some dummy file and a test console.log to find out.
Or it could also be that my require statement on line 7 of index.js needs to refer to that folder in some other way.
Think I'm getting somewhere COPY testfolder ./testfolder/ then require('./testfolder') inside index.js works.
Just won't work if I try it with the /data folder.
do you have a /data folder
Likely as data is mounted by the supervisor at startup of the container, not at build time, any reason why you would need to persist it?, if so copy it to data in the startup script
If it doesn't change, don't persist it....
upon trying to convert an addon to yaml then using the builder I get this error jq: error: Could not open file /tmp/build_config/config.json: No such file or directory
is yaml supported by the builder action?
I have a problem with the new Tuya integration. I installed a tuya climate entity. It is a thermostate. All works perfectly but in the settings the max temp is set to 122. I can set it to 30 manually, but every time I change the value of target temp it is reset to the standard value 122.
hvac_modes:
- 'off'
- heat_cool
min_temp: 0.5
max_temp: 122
target_temp_step: 0.1
current_temperature: 22.5
temperature: 22.5
friendly_name: 'NX-4526 '
supported_features: 1
setting max Temp to 28, climate card changes as intended, change target temp, max temp resets to 120, card changes as well
Hello There, I have been waiting for ages to see some progress on the Tuya based 2 Channel dimmer units. I was told by Frenck that it was going to be working in release 2021.11 and the issue was closed on Github. But I am still waiting for this to be sorted. I really would like to know how to move forward so that I do not have to use the Tuya local and new integration at the same time.
You're right, i started to suspect /data is only available after build. For this module/package i can suffice with copying it elsewhere during the build. Got it working now. thx
right, the data is available for persistent storage at runtime of the add-on, not on build time of the image, because at this time, everything else is persistent
Something doesn't seem right with the docs here. https://developers.home-assistant.io/docs/api/supervisor/endpoints
This says everything marked with a lock requires a token, but all endpoints have a lock. Here it says that certain endpoints do not require a token like /discovery* but that is clearly marked with a lock in the article above. https://developers.home-assistant.io/docs/add-ons/communication/
/supervisor/ping is the only one that does not authentication
on your second link, it say you don't need hassio_api, but you still need authentication
I guess it's hard to find in the sea of locks. The unlocked icon looks almost the same as the locked icon
Hello
I'm busy developing a Cron based backup addon for hass.
Since after the config setup the whole thing uses crontab, there is no long running service.
This is causing my run.sh script to loop.
Does anyone have a recommendation?
Only thing I can think of is an infinite loop at the end of the script?
Thanks
Yeah, or spawn an infinite sleep command
Thanks.
Hi folks, Just configuring my HIkVision NVR (DS-7608NXI-I2 / 8P/S) Firmware: V4.40.815 build 210709 but seems that the addon errors out on starting - https://pastebin.com/9qtEsbND
You want #integrations-archived
Hi! I have this doorlock(https://www.zigbee2mqtt.io/devices/BE468.html) which is supported for locking, unlocking, adding pin, link quality and battery. I want to know which user unlock the door, but the data isn't "sent" to home assistant, the information is sent on a MQTT topic, I can see it on the topic "zigbee2mqtt/mqtt doorlock" json "{"action":"unlock","action_source":0,"action_source_name":"keypad","action_user":6,"auto_relock_time":0,"battery":96,"linkquality":63,"lock_state":"unlocked","state":"UNLOCK","voltage":5700}"
I'm trying to get this info in Home assistant to trigger automation but I think it would be better if Z2M or MQTT integration was getting this information and somehow feed HA entities for the users.. So here's my question, how/where can I add this kind of thing ? Is it the MQTT integration that need to handle this data and create entities ? Thanks!
Hi, im looking to begin developement of my first adon and would like a little adivce before i start to ensure that it is as maintainable as possible. I plan to bring in the ability to use Tp-Link tapo devices using this library https://pypi.org/project/tapo-plug/#description and then integrating it in a plugin for the home assistant as i would ike the feature and have seen many ask for this. Question 1 has this been done yet and my second question would be what is your advice when it comes to threading. Should it all be run through a seperate thread or can i just not worry about threading ASYNCIO
I have a Volkswagen ID.4 that I’d like to integrate with HA.There’s an actively maintained MQTT Client available for the new Volkswagen WeConnect ID service, so I was thinking the best solution would to create an add-on for this client. How easy/difficult would it be to create this add-on?
https://github.com/tillsteinbach/WeConnect-mqtt
Hello, I've implemented autobuild on github actions by adding the workflow from the github example addon repo. Here is my repo : https://github.com/alexbelgium/hassio-addons. However, all addons that have a base of multiarch are not building correctly. They build without error but launching the addon fails with error "[FATAL tini (*) exec /bin/bash failed: Exec format error". The builder script doesnt correctly pull the correct architecture from the multiarch base image, and uses amd64 instead.
Not sure where to report it as for me it is a bug in the workflow build code. However I don't know how to correct the build workflow to correctly pull the right image from the multiarch base image. Any help is welcome!
"armhf": "linuxserver/bazarr:arm32v7-latest", that will not work, better you offer not an armhf version then
we use the same builder, are you sure that you base image arch is correct?
Thanks for looking! I've actually got the issue with all addons based on multiarch images : Filebrowser, Firefly, Joal, Joplin...
For all other addons based on single arch images (such as linuxserver/bazarr:arm32v7:latest) I don't have this error code when launching the addon
And all addons runs normally when locally building (I've removed the "image" tag from the Filebrowser and Firefly addons for example to allow them to continue working by locally building )
Good point for armhf, I've removed the version offering.
Here is an example of an addon image built with the workflow script that gives the exec error : ghcr.io/alexbelgium/fireflyiii-aarch64:5.6.10-6
Here is an example of the workflow that leads to that : https://github.com/alexbelgium/hassio-addons/runs/4865953199?check_suite_focus=true
Frenck had the same issue in 2019 and solved it by making single arch images of his base image (https://github.com/hassio-addons/addon-ssh/issues/93 and https://github.com/hassio-addons/addon-ssh/commit/c8587395d4d3058590383efc20ea29a40e0285b8). However this is not an option for me as I want to wrap the addon around an existing multiarch image... But i guess if it works when locally building it should be able to work when building on github workflow?
the docker multiarch is not that smart, you have to use our solution
There could be a solution : "With the latest docker, you can specify platform when you're pulling
docker pull --platform linux/arm64 alpine:latest"
I was wondering if we could implement that in the builder script to enable usage of multiarch upstream images, when the file build.json is not used to specify an image specific to an arch
Hey all - I am altering an existing addon (snapcast) to include audio input. I've changed the addon and now have Audio input selection in the configuration tab, and can select my input device. So now that I have all of this set up, the docs say that a "working pulse audio setup" should get passed into the container. What exactly does this mean? Should I have a device node inside of my container now? In theory, I should now be able to get Snapcast to pipe this audio input device in as a source, but I don't know how I should be referring to the pulseaudio device. This may be stemming from an unfamiliarity with pulse audio in general. This is on a Raspberry Pi and Hassio.
you have a running pulse audio system in your container including a fake ALSA configuration to the pulse audio server
so you have to know pulse or ALSA
but the ALSA is just a fake for old software without pulse support. If you software support pulse, use pulse
do you know if pulse creates a pipe inside of the container?
I found some ALSA instructions for the app I'm trying to run: https://github.com/badaix/snapcast/blob/master/doc/configuration.md#alsa
As well as some PuleAudio instructions that are a lot more barebones: https://github.com/badaix/snapcast/blob/master/doc/player_setup.md#pulseaudio
Is there any documentation I'm not finding about how Hassio sets up PulseAudio inside the container perchance?
is not needed, it just work if you have audio enabled. See at the documentation on the developer website
home assistant doing the audio setup, you software just need connect. Use ha audio info to get information about the audio on your device
can the vscode remote container for addon development be used on an M1 mac?
I don't think the hole supervisor work on M1 as we use different memory alloc and there is an fix for it, not sure if that just a fix to make it better or somethings that is needed to get it running on the M1
but next release will including that, so I wait for the 5.3 release which promising soon is out
If you find away to modify how it runs it to add --platform linux/amd64 it should work
Anyone able to help me run the Tuya WebRTC demo on mac?
Trying to pull rtsp stream from my door cam
hi all, sorry to intrude. i see active development in components/senseme which was previously an add-on integration through hacs. does this mean it's finding its way into core?
An integration, not an addon
corrected. so what's the answer?
I'm saying that you're asking in the wrong channel. #devs_core-archived is the right one
I have no idea
is there a sample integration of a simple sensor anywhere?
Also #devs_core-archived
Hi, I start writing new addon.
I set options and schema, but when the addon is installed, I didn't see the options in the configuration
options:
beer: true
test: "MyName?"
schema:
beer: bool
test: str
And in the configuration page I have the error This add-on does not expose configuration for you to mess with…
And ofc, I successfully uploaded the new changes to the addon, rebuild the addon.
I even tried to uninstall and install the new version, I can see new log event I added in the run.sh
i'd have to see the full file
@weary oxide posted a code wall, it is moved here --> https://hastebin.com/jucomulisa
done ^
looks fine on first glance
take a look at my addon for an example https://github.com/ikifar2012/remote-backup-addon/blob/master/remote-backup/config.yaml
Oh I just found that when you add new stuff in the config file, you need to click the button Check for updates
thx btw for the help 🙂
oh I was gonna suggest that next lol
Hi Is anyone available to help with a question on a creating a new Addon?
I have be following the tutorial at https://developers.home-assistant.io/docs/add-ons/tutorial/ Which has got me to the point of having an install that seems to work except when I go to run the addon it fails with not finding run.sh. run.sh existsis in the addon folder and the copy and chmod is in the Dockerfile.
Is anyone available?
looking into our test add-on
with s6
(we should once update the docs and ride out all with the old run.sh)
Hi! Im looking into creating a custom component, just wanted some direction in regards to "late arrival" data. If a sensor has recorded a value 10 min ago, will I be able to reflect this in an entity? Or will it report that the value was recorded "now".
For discussion on the development of add-ons (not integrations - for that see #devs_core)
Hi, not quite sure where to ask this question. It is about the SSH add-on. Does anyone know how to run an SSH command from 'any' computer to HA? When I run, for testing, e.g. ssh user@host ha -h, it shows the help text for the HA CLI, but when I run e.g. 'ha core info', I get ERRO[0000] Unexpected server response. Status code: 401
Unexpected server response. Status code: 401
Do you know a better place where to ask?
#add-ons-archived , the support channel
Or the community addons server, if you're using that addon
I will try that, thanks @cloud basalt .
I currently have an add-on that needs host network (webrtc server), and my impression is its needs it because it opens some udp port ranges. Would it be worth it to extend add-ons generally to support udp range port forwarding? or better to keep it simple and stick with host network?
what could cause my /data/options.json to be an empty object? I have defaults defined.
From my understanding there are still issues in Docker itself when forwarding port ranges
i see, thank you.
whoa
addons don't belong in custom_components
you probably mean "integration", and questions go to #devs_core-archived
I can't see anything incorrect on my config.yaml https://pastebin.com/BcF7Utzr
When I check the configuration on the front end it only lets me edit in yaml
but when i cat /data/options.json in run.sh it's just an empty object. bashio doesn't work either
Hey guys, I'm working on a custom addon to bridge HA and some hardware I have. I actually just migrated from using a config.yml (mentioned in the docs, but seems outdated) to a config.json. Mysteriously as all heck, that somehow fixed my $(bashio::services mqtt "host") style lines in run.sh.... but at the same time, I'm now having some hardware device mapping issues. Formerly through a pile of poorly understood options, my container was able to access the device via a udev path like /dev/serial/by-id/usb-FTDI_... but now /dev/serial isn't being mapped inside my container at all. My config.json has the basic guesses in it, udev, uart, and usb properties all set to true. Any other guesses on what I should stick in there and try next?
follow up: It's working again, so it's apparently either this, or some subset: "devices": ["/dev/bus/usb:/dev/bus/usb:rwm", "/dev/mem:/dev/mem:rw"], "uart": true, "usb": true, "udev": true,
thanks to pillaging github for random config.json files 😄
"devices": ["/dev/bus/usb:/dev/bus/usb:rwm", "/dev/mem:/dev/mem:rw"], the USB part is not needed with usb: true and access to /dev/mem only if you run old GPIO stuff
Is there some way to discover when options have been changed by the user? I tried reading out the datestamp of options.json, but noticed that is always renewed when you restart the add-on, also when unchanged.
On the dev docs to reload local addons it says to "On the top right overflow menu, click the "Reload" button". I don't see reload. am i missing something or has it been replaced by "check for updates"?
Yes, it was replaced with 'check for updates'
search + replace 😄
Hi, Is there any possibility to list all the installed addons in an addon configuration ?
The purpose is to let the user select which addon he want to monitor from the addon that will read from journalctl.
Thx @woeful otter, how can I query this API from the config.yaml.
From I understand, this will be available in the run.sh script.
You can't run dynamic things in a static configuration file
so, you can't add it config.yaml
yep, that's what I thought.
Fine, thanks again 🙂
Hi all, i'm working with a few other devs to try and get data from this Repo: https://github.com/apearson/southern-company-api into HomeAssistant, would this be the appropriate channel to have that conversation?
I wasn't sure if it would be this channel or #devs_energy-archived
None, integrations add data to home assistant, that's #devs_core-archived
Hey @turbid adder looking forward to working with you on this. Based on https://community.home-assistant.io/t/difference-between-various-ways-to-add-ons-integrations/389919/6 I think our best path forward here is a new add-on. I'm going to try to find some time tonight to experiment with creating an add-on.
Does any one have the time to review a single character pull request? 😂
And it's an invisible character at that...
Fairly basic question: What is the best way for an addon to create an entity and add data to it?
I'm working on integrating with the API above to pull data from the power company as they offer hourly insight into power usage. We have the a node services that works with the API, and we have done a rough pass at getting the addon off the ground.
I'm at the point now where i'm ready to start feeding HomeAssistant data. I did find the API docs: https://developers.home-assistant.io/docs/api/rest, which seem to suggest you can just POST data to the /api/states/entity_id endpoint, but I was wondering if that was the proper way of doing things.
Addons should never create entities, that is a job for integrations
addons run software & integration doing the core part
Can integrations talk to addons? The issue is that our API is written in Nodejs, I had the understanding that integration had to be written in python
yes
Okay, i'll do some digging into how they should communicate
yeah, we do that a lot. You see the hostname on the add-on and if you add it to the core, you can also use the discovery feature on supervisor to let core setup the integration with the information from your add-on
So, I'll piggyback off that question from two days ago... My addon is already using MQTT to serve up state information, so rather than a custom integration, I was planning on using MQTT sensor discovery to feed back data into HA, though I haven't quite gotten it working yet. Which of those two methods is generally "more preferred"?
MQTT discovery will make it easier for everyone.
It's pretty much the Home Assistant API.
thanks for the confirmation @orchid crater , it sure looked easier to me. Now I just need to figure out why the sensors aren't appearing 😄
Hi,
I want to create an addons repository. I browse a little bit the various example github repositories. I figured out, that there is a repository containing only the config.yaml and another repository containing all the files to create the docker image inside HassOS.
So my question is, what's the best practices ? Shall I have a repository for each addon (publishing all the images) and have a github repo for the home-assistant repository ?
i need to use mechanize.Browser() to visit an url with an api key, then return the element to be able to visit the next page and do a submit a form on that, but i can't seem to get this to work... any good with the Browser extension and proberly just have 10 mins to get it to work with me
you rever to community add-ons, our example is: https://github.com/home-assistant/addons-example
I'll try using your example. Thanks 🙂
Hello.
I have created a couple of add-ons, which, if I create full backups of home assistant, include an "image.tar" file. Other add-ons like deconz, esphome don't contain this file (which I'm guessing is the container image). I have googled a bit, but I can't seem to find how to disable home assistant from including this image in the backup...
I think it depends on whether you have a "image" property defined (pre-built and hosted) or the docker image is built on the device itself.
@warm tiger Ahh, makes sense, none of my add-ons have the image property set. Thanks a lot for the help!
It is a while back that i made my own addon and was using config.json. I look at the example addon and see config.yaml in the repo but the documentation mentions config.json. Which one is the preferred one?
which documentation?
Ok yaml it is
YAML is generally more readable by humans
it has it own quirks but is more readable by humans indeed
can someone help me troubleshoot why this repo is returning "invalid addon repo" when I try to add it to my instance? https://github.com/raman325/zwave-js-server-ha-addon
I feel like I am missing something obvious
I keep getting this:
weird, I guess it was a companion app issue, doing it through the browser worked
thanks
Hi all, I'm fumbling my way through making an add-on that allows you to install Scrypted on your HA instance (mainly for it's awesome Homekit camera capabilities). I've got an initial commit that works and seems to perform really well but would like some help with improvements - the main one would be adding Ingress. I've looked at repos for other third party add-ons and the ingress implementation seems different every time! I don't care about HA autoconfiguring users and I have limited ability to change source code as the add-on config.json just pulls the docker image and passes some environment variables to it.
What would be the easiest way to get ingress working? My repo is here: https://github.com/aegjoyce/ha-addons
Thanks!
I use the api and that post endpoint to create entities in my addons. Like Ludeeus said it's not the proper way, but without Python skills and lacking the time to learn it I found it the easiest way to get stuff working.
Main downside is that entities that are created through posting data to the api are not persistent and don´t survive restarts of HA. So you'll need to provide data persistence within your addon.
When developing integrations, I am keen to know how people set up their developer env.
I have a HA instance that I am using to update some integrations.
My current workflow is, copy the integration in to the custom_components folder. Make changes and when ready copy back to the repo folder. This is pretty clunky, esp when switching branches.
How do others do this, do you have your integration repo cloned directly in to the HA folder?
Thanks
Hey, is there any docs for how to start with add-on development?
Add-ons for Home Assistant allow the user to extend the functionality around Home Assistant. This can be running an application that Home Assistant can integrate with (like an MQTT broker) or to share the configuration via Samba for easy editing from other computers. Add-ons can be configured via the Supervisor panel in Home Assistant.
Thx!
How does an addon indicate that it is able to be shown in the side menu (like, e.g., RaspberryMatic)? I tried to copy some options from the RaspberryMatic config.yaml, but doesn't seem to have an effect locally...
Never tried it but what about the panel stuff here? https://github.com/hassio-addons/addon-zwavejs2mqtt/blob/main/zwavejs2mqtt/config.yaml
Edit: haven't worked with ingress at all and haven't found doc connecting the panel stuff above to ingress so may be unrelated. Sorry, possible misdirection.
Thx! Guess this is the right stuff, but I assume I had a syntax error in my config and therefore changes were not recognized... Will continue working on that this evening. But thx anyways for helping 🙂
I’m having the same issues, see a few posts back. Not sure what I’m doing wrong but seem to have tried all possible combinations of the ingress options in config.yaml/config.json and none of them work, I just get a 502 error
Is your app listening on port 8099? Did you configure ingress_port?
I currently experience the issue that I defined ingress_port to be 8080, but the supervisor logs still complain that the app cannot be reached at port 8099... Looks like it is ignoring the port currently in my situation
Got unexpected response from the API: No access to mqtt service!
but I have ```yaml
services:
- mqtt:want
added quotes around mqtt in MQTT_HOST=$(bashio::services "mqtt" "host")
seems to work
No reference to look at but yeah sure 🙂
But still if its a dependent service, set it to need
Otherwise the addon can start without it I believe
I want them to be able to manually set mqtt if they need to
that was odd, it was just the fact that mqtt wasn't quoted but my other addon seems to work but its not quoted
Hi there - I have a pull request in for the dhcp_server plugin I changed to get make NTP server config available - however it's failing on ShellCheck and I don't know how to sort it - so need suggestions to move it forwards please.
I am being given the following two warnings
Warning: programs in PATH should not have a filename suffix
and
Warning: ./dhcp_server/data/run.sh:24:6: warning: Quote this to prevent word splitting. [SC2046]
I don't reference that path anywhere in the config - so am I being daft and missed something?
By default Scrypted exposes on port 10443, I can access it directly by at [host]:10443 but if I specify the ingress port as 10443 I just get a 502 bad gateway when accessing through the UI
Sure that it does it already with the initial requst? Or is [host]:10443 is redirecting you somewhere and the redirect target does not contain the ingress path? That's what I experienced my self when trying out ingress...
So it redirects to [host]:10443/endpoint/@scrypted/core/public/#/.
I updated my config.yaml to include:
ingress_port: 10443
ingress_entry: /endpoint/@scrypted/core/public/#/```
But still getting a 502 bad gateway. Supervisor reports:
```22-02-23 12:53:36 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:10443 ssl:default [Connect call failed ('172.30.32.1', 10443)]
22-02-23 12:53:39 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Server disconnected```
The redirect needs to include the ingress path
/endpoint/ is (I guess) part of the URL of your application you want to have proxied. This needs to be prefixed by the ingress path so that HA knows to proxy the redirected URL to your app as well
Ok, I think I realise now the problem is I fundamentally didn't understand how ingress works on the add-on side and that it needs some config! So i need to find a way to get an ingress config into the image that I'm pulling
Any suggestions on what would be the best way to set this up? Currently I don't have a dockerfile, I'm just using the config file to pull the latest image from koush/scrypted. Can I still do this and then use a Dockerfile to make any extra modifications required? How does it work when you use a dockerfile to build an image AND specify an image to pull in config.yaml - does one inhibit the other or do both happen and in what order?
I think it's more about the configuration of that redirect. You need to tell that application to prefix all absolute URLs with the ingress path
That's just it though, I'm pretty certain the Scrypted image doesn't run an ingress server, therefore no path to point to. I think I'll need to make my own image with an ingress server to make this work
Hey Folks, I I want to develop a new add-on an followed the instructions on Local add-on testing where it is recommended way using a local Visual Studio Code devcontainer. So far so good, followed the installation steps, and ran the (Terminal -> Run Task) 'Start Home Assistant' task, which will bootstrap Supervisor and Home Assistant. but I get the following error:
22-02-26 15:39:41 WARNING (MainThread) [supervisor.security] Disabled content-trust, skip validation
22-02-26 15:39:41 WARNING (MainThread) [supervisor.updater] Can't process version data: 'qemux86_64'
22-02-26 15:39:41 WARNING (MainThread) [supervisor.plugins.cli] Error on install cli plugin. Retry in 30sec
Any ideas what is wrong here?
Thx for the info, any workarounds till it is fixed? @rigid shard
Change L119 in /ets/supervisor_scripts/common from -e SUPERVISOR_MACHINE="qemu${QEMU_ARCH}" \ to -e SUPERVISOR_MACHINE="qemux86-64" \
OK, where do I find the file?
/ets/supervisor_scripts/common is the file?
Al I have is a .devcaontainer.json file and the folder of my add-on I am gonna build
okey, then you wait untill fix has been merged
And you pull a new image after it's built
Ah U mean in the devcontainer ... repo ... you mean to build my own based on the official with the suggested change
no
So why is it that hard to explain where to find the file /ets/supervisor_scripts/common?
I would appreciate some support on installing a binary on top of the add on base image.
Where do I need to put the binary into?
RUN apk --update add erlang && rm -rf /var/cache/apk/*
RUN mkdir usr/bin/gleam-lang
RUN cd usr/bin/gleam-lang
RUN curl -Lo gleam.tar.gz https://github.com/gleam-lang/gleam/releases/download/v0.20.1/gleam-v0.20.1-linux-amd64.tar.gz
RUN tar xf gleam.tar.gz
RUN chmod a+x gleam
COPY rootfs /
Running gleam --version leads to unknown command error
Easiest:
- remove the mkdir
- do the cd to /usr/local/bin
Hi,
Is there anyway to avoid having this error in a add-on (firewall add-on that need host network to add rules using nftables)
time="01-03-2022 16:47:31" level=fatal msg="Receive: netlink receive: operation not supported"
I added with privileged option NET-ADMIN capability but still got the same issue.
I even add all cap and also full_access:true just for test but still got the same issue. If any one has an idea please.
Update:
So, I figured out that the home assistant OS didn't have nftables and we can't install it. So I switched to iptables but I still need ipset and it's not installed by default in the OS and there is no way to install it.
Shall I created an issue to ask for it ?
Hey Folks, quick question ... how can I mount a volume to sync files between the config folder and some folder in the add-on container?
There are 6 possibles shares you can get mounted: config, ssl, addons, backups, media and share
You can use the map add-on configuration option for that. See: https://developers.home-assistant.io/docs/add-ons/configuration#optional-configuration-options
Awesome, thanks a lot
Hello, is there a possibility to install addon from a repository branch or use branch as a beta release or something like old-stable?
Hey all - I'm having issues with custom components since today's update. Am I in the right place to report the issue?
@amber mist posted a code wall, it is moved here --> https://hastebin.com/sowohineyi
Hey all, I am working on an addon, which requires the history api from home assistant. however, when I do a get request from outside of the container, it all works fine, but when the same get request is executed from within my addon, than it gives an error 401 "Unauthorized". Does someone know what the problem may be? I used both the localhost:8123 and supervisor/core as url in the addon, and it does not work
You may check out https://developers.home-assistant.io/docs/add-ons/communication which tells about addon authentication with home assistant
@austere torrent posted a code wall, it is moved here --> https://hastebin.com/icugahemoq
Hello, I've built a docker container which uses some bluetooth capabilities.
In order to make sure everything is working fine, I've tried in my docker container to run bluetoothctl paired-devices and made sure it gave me the same list as I've got on my host.
It works perfectly. In order to get that though, I need to pass the following parameters when doing docker run: --privileged -v /var/run/dbus:/var/run/dbus
If I remove one or the other argument, it doesn't work anymore.
I've built a tiny add-on config where I'm trying to have all this wrapped into a HA add-on. Unfortunately, I always get
dbus[9]: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 5905.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
/run.sh: line 11: 9 Aborted (core dumped) bluetoothctl paired-devices
@austere torrent posted a code wall, it is moved here --> https://hastebin.com/qiyetalore
Any idea how I can make sure to have the equivalent of --privileged -v /var/run/dbus:/var/run/dbus?
Thanks!
(just to clarify, but I've ofc looked at https://developers.home-assistant.io/docs/add-ons/configuration#optional-configuration-options many times and I still haven't found what I need)
Hi everyone. I'm brand new to making addons. I just want a simple addon to run another executable. Is there an addon for this already, or where should I start for creating this?
I was able to get a basic addon set up, but it's not clear to me how to access the addon directory and run something from that directory. If I try to "cd" to "/root/addons", I get a "No such file or directory" error in the log.
/addons
any ideas why I can't get the webui option to work. putting "webui: http://localhost:8080" in the config.yaml breaks my addon but I don't see any errors to tell me why
Hi, what is the best option to send error messages from device over mqtt?
For Solar Analytics integration into HA energy management see
https://github.com/PeterH24x7/-Solar-Analytics-integration-for-Home-Assistant-Energy-monitoring
I want to develop my addone Very difficult
The rova api has been updated to rova 0.3.0 (and works well). If you update the rova integration so I can remove my custom integration? 😇
Hey,
I’m pretty new to Home Assistant and currently trying to run a self build docker-container as HA OS Add-on. The „Tutorial: Making your first add-on“ describes this process pretty good. But as I understand it correctly, the defined Docker Image is build at the install process on the .
Here my question: Is it also possible to run the add-on container, without to building the image and only load the prebuild image from a container registry like ghcr.io ?
@summer urchin posted a code wall, it is moved here --> https://hastebin.com/rayereqeci
@cloud basalt got it working after adding the add-on under a new name. Thanks for the link.
Studio code server causing high cpu/memory leak - wondering if anyone has seen this in their setup
This the wrong channel for this question?
Yes
For discussion on the development of add-ons (not integrations - for that see #devs_core)
https://developers.home-assistant.io/docs/add-ons
Question: wasn't usb: true supposed to automount --device /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, etc?
nope, that are uart interfaces
not usb
there are driver which act on the usb and provide the uart. but if you want access to uart, you have to use uart
usb is only used for devices they act to the raw usb stack and not have an upper device driver on it
@astral briar got it. Thank you so much!!!
Please help to understand. Here is a fragment of my base image Dokerfile:
RUN mkdir /share WORKDIR /share COPY examples/ /share ENTRYPOINT ["python3", "/share/testweb.py"]
when i do 'docker run' python script starts ok. When I'm start this container as hassio addon im got:'python3: can't open file '/share/testweb.py': [Errno 2] No such file or directory'What am I wrong?
Hello, I'm trying to develop an add-on for my Python Package: https://github.com/davidusb-geek/emhass
I built this package and tested it using Home Assistant Core.
To develop the add-on I followed this guide: https://developers.home-assistant.io/docs/add-ons
The devcontainer works fine using vscode. But when I try to install my add-on I just can't install the requirements for my package correctly. A google search showed me that it will be difficult to install Python dependencies with these alpine images. So at this point I'm just starting to figure out if this will be possible at all and what are my options to achieve this? Can anyone please give me a hand here, a little guiding to the correct option will be highly appreciated.
Here is the repo of my current add-on showing the Dockerfile: https://github.com/davidusb-geek/emhass-add-on
My impression is you can use any base image you like so you aren't limited to alpine.
but also, alpine can be a little tricky for some things with heavy C dependencies, but i would not say in general its difficult to install python images, so with that level of detail, unclear. But sounds not specific to home assistant really...
Are you really sure about this? Tried to install with many other different types of images and it always fails with many errors. I'm no docker expert so maybe that's an issue, but still
If you look at my Dockerfile are you able to spot what I am missing?
you haven't said anything about the problem
Step 6/16 : RUN apk add --no-cache --virtual .build-dependencies gcc=9.3.0-r0 libc-dev=0.7.2-r3 libffi-dev=3.2.1-r6 openssl-dev=1.1.1l-r0 && apk add --no-cache dbus=1.12.20-r1 && pip3 install --no-cache-dir --prefer-binary --find-links "https://wheels.home-assistant.io/alpine-3.14/${BUILD_ARCH}/" -r /tmp/requirements.txt && find /usr/local ( -type d -a -name test -o -name tests -o -name 'pycache' ) -o ( -type f -a -name '.pyc' -o -name '.pyo' ) -exec rm -rf '{}' + && apk del --no-cache --purge .build-dependencies
Stuck at this step while installing my add-on
ERROR:
unsatisfiable constraints:
musl-1.1.24-r2:
breaks: musl-dev-1.1.24-r3[musl=1.1.24-r3]
satisfies: world[musl=1.1.24-r2]
libc-dev-0.7.2-r3:
masked in: @edge
satisfies: .build-dependencies-20220320.173840[libc-dev=0.7.2-r3]
libcrypto1.1-1.1.1d-r3:
breaks: openssl-dev-1.1.1l-r0[libcrypto1.1=1.1.1l-r0]
satisfies:
world[libcrypto1.1=1.1.1d-r3]
libssl1.1-1.1.1d-r3:
breaks: openssl-dev-1.1.1l-r0[libssl1.1=1.1.1l-r0]
satisfies: world[libssl1.1=1.1.1d-r3]
libcurl-7.67.0-r0[so:libssl.so.1.1]
apk-tools-2.10.4-r3[so:libssl.so.1.1]
you've got incompatible versions
remove all your version dependencies e.g.
"=X"
"unsatisfiable constraints" basically means you are adding a bunch of constraints that can't be satisfied. but yeah, this is a bit out of scope of home assistant
Ok thank you anyway, I didn't thought that it was out the scope of hass. You helped me already, I tried with this base Python image: python:3.8-slim-buster
And it worked... The main issue here is that these images will take more space than the alpine images. But maybe the slim option is good enough
I found https://pkgs.alpinelinux.org/packages helpful to understand various options for package versions on specific versions of alpine if you want to sort through it
Hello, is it possible to customize the ingress url to have only lower case ? Several apps (emby, sonarr, ...) have a toLowerCase() function in their js url propagation that prevents ingress from working (supervisor denies access to the lowercase url with a "Ingress for * lowercase token * not available"). What I've tried : 1) ingress_entry option but it simply adds to the existing ingress url and not replace it, 2) modify js files with grep and sed to remove toLowerCase but although it allows to connect to the webui, it prevents media streams. Here is my test repo if useful : https://github.com/alexbelgium/hassio-addons-test. Thanks very much!
promtail
Hi, does anyone knows how can i request a new device to be integrated with ZHA ?
its the new aqara FP1 sensor, it paired with ZHA but no entities
Does it need mqtt?
Can anyone release a new version of the Grocy Addon? The Addon has been a bit broken for a while (navigation not working) and the fix has already been merged but no release was created.
This is not a request channel.
OK sorry
Hello, am i right to infer that the absence of response means that there is no way to force a lowercase ingress url for an addon through its config.json ? Thanks!
Is there a place to request this feature (custom ingress url through addon config.json) ?
Is support for Apple Home key comming to HomeKit addon?
Hi, the best for you is probably to post your request on the github repo of the addon (or integration) for which you want the feature. Here is the repo for integration (there is no official addon) : https://github.com/home-assistant/core/tree/dev/homeassistant/components/homekit & https://github.com/home-assistant/core/tree/dev/homeassistant/components/homekit_controller
I put this on the community channel but maybe better here...
Hey - I'm trying to create a python add-on. I've taken the example addon doc (https://developers.home-assistant.io/docs/add-ons/tutorial) and then change the Dockerfile to use the python base add on and commented out the apk add python3 a I expected python would come with the base addon. However when I try to start this modified hello_world example I get:
/run.sh: line 5: python3: command not found
What am I missing?
Is it python or python3 that's included? Also, you defined the base image correctly everywhere? Is your code online, helps to check.
@near sinew posted a code wall, it is moved here --> https://hastebin.com/oxemevatev
and run.sh is just
#!/usr/bin/with-contenv bashio
echo "Hello world!"
python3 -m http.server 8000
it isn't python either:
/run.sh: line 5: python: command not found
I was expecting it to work similar to the normal python base images...where the image has pip and python installed:
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
this works, so it appears that it's installed:
docker run -it ghcr.io/hassio-addons/base-python/amd64:8.1.1 python3 -V
as does just "python"
I changed the command to tail Dev null and went into the container and did afind / -name python* so I'm obviously doing something wrong
ARG BUILD_FROM=ghcr.io/hassio-addons/base-python:8.1.1
FROM $BUILD_FROM
is that the right way to use it? I've not done much with docker before
Ok so I figured it out.
Start of the Dockerfile needs to be:
ARG BUILD_FROM
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
Then in build.yaml
build_from:
amd64: ghcr.io/hassio-addons/base-python/amd64:8.1.1
...
Not sure that is clear from the developer docs
I am trying to connect to the HA WS API inside an add on. I send:
{'type': 'auth', 'access_token': 'SUPERVISOR_TOKEN'}
as per the docs but I get back:
{'type': 'auth_invalid', 'message': 'Invalid access'}
I've also added homeassistant_api: true to my config yaml
with the real supervisor token from the environment
I've got it working using the external ws api and a long lived access token for now but I'd prefer not to do it that way. Does anyone know of a sample python addon that connects to the ws api?
Using @high thorn RTSP to webRTC. I'm within touching distance of getting an alpha version of a generic (no audio) video doorbell for Alexa.
So when the bell rings it will show the camera on an Echo Show. I think it would also pop up a small preview picture on a firetv.
What do I need to do to get a toggle with the text "Show unused optional configuration options" like the esphome addon has? I can't see it documented here: https://developers.home-assistant.io/docs/add-ons/configuration#options--schema ?
Show unused optional configuration options
👆 Have unused configuration options
configuration options that are defined in the schema, but not present in the configuration (and thus marked optional as well, or else it would be invalid)
Nice one. Thanks @woeful otter
I'm trying to publish my addon. I've got a repo that shows up. It is an addon that I wanted to build locally but it doesn't seem to build as I expect so instead I thought I'd try to publish to dockerhub. First time I've done this. I'm trying to use the docker builder however i'm getting:
See 'docker build --help'.
But I don't add a -t so i'm confused (well I do but it isn't related to tags) - this is the page i'm following: https://developers.home-assistant.io/docs/add-ons/publishing#custom-add-ons
Found this issue - https://github.com/home-assistant/builder/issues/79
Might need a doc update
I dont suppose anyone knows what HA lists bluetooth under for the device? Trying to pass it through to a container but can't find it
Moved to #developers
This is the channel for addons (which are different from integrations/custom_components). You have better chances in #developers or #devs_core-archived
Finished my work (I Think) on a remake of the RTLAMR2MQTT Addon, into the RTLAMR-2-HA Addon. which publishes using the HA REST API rather then MQTT https://github.com/cpyarger/RTLAMR-2-HA
Any feedback would be appreciated, 😸
Where are python packages that custom_components depend on in the home assistant docker container?
Hey, I wrote an add-on that has an optional config option for a port, which is only needed when a specific driver is selected. In order to get some form of evaluation, I have added port? as schema for this option, but it appears that the related option is still not allowed to be empty. Is this a bug in the supervisor? Docs don't mention which schema types can be optional, or at least I haven't found it
I also have an optional device? option, which is not treated as optional
I read that, and it says If you want make an option optional, put ? to the end of data type, otherwise it will be a required value. - but the ? suffix is not working for device and port
another question: according to the docs, the options/schema can have nested arrays/dicts of 2 levels down, so this should work, right? Or is mountpoints here considered to be the first level already?
schema:
mountpoints:
- slug: "match(^[a-z]+$)"
host: str
mac: "match(^[a-z0-9]{2}\\:[a-z0-9]{2}\\:[a-z0-9]{2}\\:[a-z0-9]{2}\\:[a-z0-9]{2}\\:[a-z0-9]{2}$)?"
shares:
- slug: str
type: "list(smb|nfs)"
path: str
username: "str?"
password: "password?"
options: "str?"
ah, since shares is associative, it's the third level?
Hi, for port just type "null" instead of the specified port and it won't be prefilled. For devices I don't see how you can make it optional, as you select the accessible devices without user input. The ? is only applicable to schema (ex : str? for an optional string). I would suggest to look at the doc linked above and check a few existing official or community addons to check how they are structured!
I know that I can just use null and have the user pick a port, but it's not mandatory for my add-on. It is only required if the user is selecting a specific driver/interface to use for the KNX communication. So unless they don't choose any IP based driver/interface, the port is not needed at all.
Also, the error message displayed when I simply use null is not helpful at all. I had the first bug report in my add-on that they can no longer save the config options within 30 mins after deploying this change.
And I read the linked documentation above several times. It only states what I have quoted above in regards to optional schemas - there is no mention for which schema types it applies, so one has to assume it applies to all
I don't think then it is feasible, my understanding is that "schema" only applies to "options". In this context I would use the port description, and the Readme to say for which conditions to use it... In a similar situation, I also used a validation at start of my script : if the port is set and the option not, you can use a bashio::log.warning message to say this is misconfiguted. Last bit not least, you can use a python script to set dynamically the port or not based on the addon selection using the HA api option. Sorry if this is not fully helpful for you, I mainly learned by trial and error how to navigate around the way HA system is set.
I'm trying to get homeassistant/amd64-builder to build docker images locally from a git repo. The command I'm running is docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock:ro homeassistant/amd64-builder --amd64 --test -r https://github.com/arnonym/ha-plugins-next -b main -t ha-plugins-next/ha-sip, but I'm getting the error jq: error: Could not open file /tmp/build_config/config.json: No such file or directory. Seems like the -t parameter is wrong, but I can't figure out what it should be. Anybody can help me with that?
does anyone have a good example for setting up cas with the builder
Hi, not sure if that's what you seek but I've implemented it in some of my addons.
- I've added CAS_API_KEY to my github environnement secret. The environnement is called CR_PAT in my example.
- I've added the signature owner in both build.json and config.json (ex : https://github.com/alexbelgium/hassio-addons/tree/master/webtop_kde).
- I've modified my build workflow to add CAS_API_KEY to the env, while referencing the environment in which this secret was placed (lines 34 and 78/79): https://github.com/alexbelgium/hassio-addons/blob/master/.github/workflows/onpush_builder.yaml#L34
At next build, it is signed
And here is another example with an "official" community build script : https://github.com/hassio-addons/addon-bitwarden/blob/main/.github/workflows/deploy.yaml
no ikea air purifier and ikea shortcut button availiable to deconz wia conbee II?
Hi,
I'm currently using the Husqvarna_Automower extension from HACS and it use the Vacuum entity
Is it possible to change the Name of the state for example changing "CLEANING" to "MOWING" ?
Thanks
The Vacuum platform doesn't have such a state, see: https://developers.home-assistant.io/docs/core/entity/vacuum#states
I can see the state "STATE_CLEANING"
and inside the code of HA at http://shorturl.at/tAGO1 line 74 we have "Cleaning"
Ok thanks 🙂
another and last question 🙂
Is it possible to have trigger when vacuum is in state "STATE_ERROR" and "STATE_RETURNING" ?
yes, use a state trigger
Right. It’s almost time to reopen the issue about adding a lawn mower entity again…
Good point. I’m also at the point to buying one. And also find someone who can create an official Husqvarna automower integration in HA core.
Wrong channel, but the guy who did the one on hacs had a PR for one I think. It died for various reasons
Could have been Gardena. They’re the same thing more or less.
Hello guys, i wanted to know if it is possible somehow to set the remove_container=False argument on a addon / docker image. Currently it seems to be only used by the homeassistant docker image; all ofther addons have a fixed setting set to True
so when i restart my addon it will cleanup the container but i'm using a 3th party docker image which is statefull within the docker image itself. So a restart currently looses all my settings made.
if i could set the remove_container flag within my addon config to False this problem would be solved and i can use the addon successfully
Not sure how a container can be stateful... Containers are ephemeral, it you want to persist data, map a volume and use that
I also don't think that's what that flag does, the whole concept of containerisation is that they are identical at start-up no matter where they are run
That is not the issue. Docker itself provides the functionality. Only through supervisor this isn't configurable. The docker image owner doesn't allow persistence on a mapped volume. As long as the container exists, it is persisting settings within the container. So if you just stop and start the container, it will use the settings previously made. At this moment restarting the addon is removing the container and creating it again. the HA image itself, when restarted isn't removed either so supervisor is able to provide this functionality
so basically what i ask for is an option to specify the --rm flag for an addon
from the docker documentation:
By default a container’s file system persists even after the container exits. This makes debugging a lot easier (since you can inspect the final state) and you retain all your data by default. But if you are running short-term foreground processes, these container file systems can really pile up. If instead you’d like Docker to automatically clean up the container and remove the file system when the container exits, you can add the --rm flag:
If you want to quote docker documentation would suggest you read https://docs.docker.com/storage/
Sounds to me that an addon managed by the Supervisor isn't for you
the supervisor has an option internally whether or not cleaning up containers after stopping them, so the only thing needed is to control that option within the addon config
everything else is working fine using supervisor
nevermind fixed it using the console application provided by roon deep harmony
Are there any good example addons that use bluetooth devices? Having issue configuring alpine to work correctly with the bluez package needed.
Hi, I'm having some issues setting ingress with an add-on and would appreciate some help. I've used code from one of Frencks repo's to get nginx and my service to fire up. Both services start up as expected and the server seems to be returning correct data when I use curl -i.
When accesing the service, it immediately does a 302 redirect to /endpoint/@karmic quarryrypted/core/public/, which I believe to be a Vue server. I need to somehow accomodate for the redirect in my nginx settings and that's where I'm struggling: it seems static files are not served.
Any pointers what I should be looking for? My ingress config currently looks like so: https://www.toptal.com/developers/hastebin/jorenuhifo.nginx
I think I figured it out. I hadn't noticed the need to search/replace a string during setup.
For the docker schema the docs say I can define a list "list(val1|val2|...)", but is there a way to represent it as checkbuttons instead of radio-buttons (let the user select multiple items)? Or maybe I just have to create individual bools for each
is there a good way to test a modified add-on? For example if I want to test out a proposed change to one of frenk's community addons?
It is pretty easy to clone the repos into /addons and make changes and test it as a local addon, except that does not work very well for some addons. Like if there is state data from the add-on, it is a real pain to copy it over via host shell, etc. Plus if the addon is used by any integrations, i need to update config entries, or yaml.
It's not clear to me if there is an easier way.
fork the repo on github, add the forked repo as a new repo in the addons store
you can easily make changes and push them up to github
then just check for updates
dont forget to change the version number in the config.yaml file
That works? I was expecting that would just give the add-on container a different name and not count as an upgrade, since the hash portion of the name seems to depend on the repo the addon came from.
You are making a modified addon, it should be different.
copy your config section, or screenshot it. and install your version of the addon,
Yeah, that not ideal with stateful addons, where copying the state from the addon's data directory can be desirable. This for example is the case with zwavejs2mqtt, where important info (like the security keys) is stored locally by addon.
Is there a way to set the unique_id of a sensor created via the rest api? I have passed it in as an attribute, I have also tried passing it in as a regular value, but that doesn't seem to make a difference.
if you need to look at the code to check its the SDRMR (SDR Meter Reader) addon https://github.com/cpyarger/Home-Assistant-Addons
so the recorder (history) have removed the get_state.. What can I use now?
Add unique ids to sensors (@shaiu - #71367) (sabnzbd docs) in latest update of HA
Hello, many mounth ago i have create an addon using /dev/ttyUSB0 (on Raspi4 standart configuration), it run very well. I must create a new Home assistant system, i copy/paste all my addons directory on new Raspi, and on seriel opening i have this message :
ERROR:root:Unable to open serial port: [Errno 1] could not open serial port /dev/ttyESB0: [Errno 1] Operation not permitted '/dev/ttyUSB0'
i have the same release of H/A/ in both rapsi; what is the problem ?
i had same issue and this is how i solved mine
port: >- /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_2cf90077ddc9eb11b1778b4f1d69213e-if00-port0
you need to find your full device string.
can't remember how i found it tho but sure someone can fill in here
this example is for my zigbee dongle running on USB0
also in error log it says ESB0.
sure you donät have a typo in config ?
it's called using serial by-id
Hello everyone!
I want to try and build an addon to use https://github.com/open-eats in HomeAssistant.
Can anyone try to point me in right direction on where to start?
I read the dev guide for addons, but that didn't really help me, as I don't want to create a new programm, but to integrate an existing one into Home Assistant.
I would really appreciate your help!
Hi all.
My name is tomer and I'm the developer of Broadlink Manager.
I'm in the proccess of creating addon for it (Will be mi first) and I need help with Env vars.
Can someone please point me on how to add it?
@cloud sky do you mean the configuration options that can be set on the addon UI in home assistant?
those are not environment variables, but they have a similar purpose
No, i'm talking about ENV
okay, but then what is the exact question?
I need to allow the user to pass env vars to the addon (like environment in docker comoose)
TimeZone, nic mac address, ip address and some other vars
but does it need to be env vars going into docker?
user configuration is done like I said
not using docker ENV
or do you mean they need to be passed through from the host sytem?
Yes, i need it as a ENV becaue i'm using the same docker file which is using enviroment variables
you'll have to extend the dockerfile / make your own dockerfile that builds on top of the other one
if you create your own entrypoint script, read the configuration with bashio::config and export the variables before running the original command
O.k, I'll take a look on that.
I have a strange situation with bashio::config right now
if I call it in run.sh (with shebang #!/usr/bin/env bashio, CMD [ "/run.sh" ] in docker; init: false in config.yaml) it fails to make a connection to the API to fetch the config:
parse error: Expected string key before ':' at line 1, column 4
[13:52:46] ERROR: Unknown HTTP error occured
but if I have the run.sh script block (e.g. with a long sleep or a loop that I can manually break) I can docker exec -it ... bash into the container
if I run bashio from that exec shell it works
and once I have done that once, the config is cached so I can close my docker exec shell and the rest keeps running well also...
ah... I think I got it: the shebang has to be #!/usr/bin/with-contenv bashio now
Hi, the way I pass addon options as env variables in my scripts is through the export command. Here is an example of a script that you could take inspiration on that exports all addon variables to env variables, if the final app is run either through /etc/cont-init.d/*run.sh or /etc/services.d/*/run.sh : https://github.com/alexbelgium/hassio-addons/blob/master/.templates/00-global_var.sh
Fixed env variables can be defined either in the Dockerfile with the ENV command, or in the config.json "environment" key
Thanks,
I'll look into it.
Hi all!
I am wandering about how to make an addon register an entry via mDNS in HA. Installing avahi daemon on the ADDON should not be the recommended way to do so, as it will compete with the mDNS stack hosted by HA container, won't it?
Is there anyone who can point me in the right direction?
balloob#6041
8
54
2
93328
22
Admin, Advisory, Bot, Dyno, Mod, Announcements, Creators Support, Creators, Podcast Host, Jedi, Padawan, Aparecium, Accio, HassBot, Muted, Zapier, Nitro Booster, Member, Conference Speaker, Conference Backstage, HomeAssistantBot, @everyone
Hi, with the recent change in docker images (https://developers.home-assistant.io/blog/2022/05/12/s6-overlay-base-images/) process.env.SUPERVISOR_TOKEN does not work anymore to obtain the supervisor token in my add-on's javascript.
How can I obtain this now? Or what extra addon config options do I need to get this working again?
You would use the addon option to get access to the host's DBUS (host_dbus: true). Then you can in theory register services for systemd-resolved's mdns responder via org.freedesktop.resolve1 and the method named RegisterService. see man org.freedesktop.resolve1 for the method declaration. I've not been able to find any documentation on how to call this service, because normal way to specify such services are runtime is to drop *.dnssd files into /run/systemd/dnssd. (But that won't work from an addon, since there is no option to map that directory into an addon.). But the DBUS API is stable and supported, so if you can figure out how to use it, it would work. You will probably need to talk with the systemd folks to find out what parameters you need to pass to the function. Or alternatively, read the systemd source to figure out the same thing.
I guess for port mapping ect, it would make more sense to create an supervisor API and your add-on can request to register a service. On supervisor we have the dbus allready exists for resolve1 and we know the real port which it will have on the host
hi @astral briar , as you wrote that blog article about the base image change, do you have any clue how this change affected the method to obtain the supervisor token? (see my post above from may 17)
that work if it use the s6 ways to get the service running
you can use our example add-on
does that mean I need to adopt the whole folder structure form the example and move my run.sh to rootfs/..., or is it enough to add these commands to the Dockerfile, together with adding the build.yaml?
ARG TEMPIO_VERSION BUILD_ARCH
RUN \
curl -sSLf -o /usr/bin/tempio \
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}"
ok, I figured it out with some trial and error, it's only the #shebang at the beginning of run.sh that needs to change to the new format
I would suggest you add that info to the 'Minimum' section of the blog post for other developers.
Hi all, I can't seem to access the mqtt service from my addon, when trying to get the mqtt variables i get "ERROR: Got unexpected response from the API: No access to mqtt service!", ive included serivces: - mqtt:want but it doesn't seem to work, any suggestions?
Hi All,
Is there a way in python to verify that I'm running on hassio/hassos?
I have an idea regarding passing options to env vars in a quick and simple way
and one more question (:
Do you have an example for signing images in the docker hub?
I want to publish my containers using the docker hub and i'm getting trust error.
Hello tklein, I started to make some experiments with python_scripts, honestly I believe there are better option´s to do so in the guides, if you run your python code as service you can use: data.get ... param = data.get("param") ... the line should be in the python code and in the services.yaml in python_scripts folder under config: ... python_script_file_name:
name: name_of_service
fields:
param ... or run the python script with: platform: command_line and in this case python environment manage the execution of the python code with the command line you pass. Once again I´m sure there is a better way to do this.. but it takes a little of more effort, and honestly it would be interesting to know the right how to 🙂
Hi @astral briar : that would be the best way to have mdns service exposed correctly, as this would better address both the the host and natted network cases.
Do you guys have any plan about that?
While waiting for pvizeli's hints, I was able to do what you suggested by using the python-dbus library and by looking at the resolve1 C specs.
By doing so, the service is correctly advertised on mdns via HASSIO OS. Yet, I agree with pvizeli as that would not be ideal for long term support: it may have more sense to expose an API via the supervisor to handle this requirement. Shall I open an feature request for that?
I fully agree with pvizeli that a supervisor api is a better long term solution (especially since it can e.g. unregister service if the addon container completely crashes, and has easier access to the user chosen exposed port number in case it differs from the container's port number), but since it was still technically possible to do it without supervisor changes, I suggested that approach, since it would not require waiting on the supervisor feature request. (Because it can potentially take a bit before pvizeli or the others get to any specific feature request, especially if implementing it requires further research, and then your addon still needs to wait until the the feature is released in the stable supervisor channel before it can rely solely on the supervisor without a fallback).
But by all means do file the request, and please do include the details on how you call that resolve1 API. (i.e. what parameters you needed to pass etc).
Hello
I got my Pi Sugar 2 today
And i'm thinking of making an add-on for it in home assistant
is there any add-on for it in development already or not ?
I never made a hass OS add-on before but i know python (:
i thought working on an already in-development addon would be simpler than working from 0
Check this repo out: https://github.com/home-assistant/addons-example
The ha folks really help you in getting things ready. Just spend some time reading what they have written, and you'll be fine. Here's where to start: https://developers.home-assistant.io/docs/add-ons/
thank you :3
do you know docker?
all an addon is, is a docker container
its fun
i dabbled in docker a bit a loooong time ago
so i'll probably have to re-learn everything (: lol
I recently signed all my docker images, if you need any help, I am more than happy to help
https://github.com/ikifar2012/remote-backup-addon/blob/master/.github/workflows/publish.yaml
https://github.com/ikifar2012/remote-backup-addon/blob/master/remote-backup/build.yaml
https://github.com/ikifar2012/remote-backup-addon/blob/1292469ef6beb59ac3504f27d7dcab27ff0bee49/remote-backup/config.yaml#L7
I am currently trying to figure out how the home assistant community addons repo workflows work, I want my addons to auto update the main repo on release publish without me having to manually update the config.yaml in my main ha add-on's repo
Hi, does anyone have an example addon that works with pytorch? I have a script that works locally, but just cant manage to use a docker image that has pytorch
pip install torch within the original image does not work, and neither does using "image: pytorch/pytorch" in the config. (do I need to specify that it comes from hub.docker.com in some way?)
just use the base image and install pytorch within the dockerfile
the image is no specified in the yaml but rather the from statement in the dockerfile
the image section in the dockerfile is if you are building the image separately from the repo with the addon and need to specify where to get it from
I get that there are no versions available when installing with pip
what permissions does the repository updater personal access token need?
Hello guys, I am using a home assistant installation on a rpi4 ... everything was working fine for me ... after a core update ... the same thing happens to me again and again ... the sound output/input is not working ... trying to use almond-genie ... 503 : bad gateway ... everything related to sound is just not working ... this scenario already happened to me so the unique solution that worked is formatting the sd card and reinstalling hassos
anyone know how to fix this?```
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
Hi All, I am using the Zigbee2MQTT addon but accourding to Github I should be having version 1.25.1 whereas the versions according to docker ps and the AddOn page is 1.18.1-1. Is there a way I can force the update?
--UPDATE--
Never mind, apparently the Zigbee2MQTT repository URL I had was an old one
It tells ya
git config --global user.name ikifar
git config --global user.email "ikifar@blackhole.void"
Someone already Installed chrome and puppeteer in a container? not sure if I should take the alpine or ubuntu base image
also, is it possible to give a addon write access to config/www?
Ewe link, why do I have to manually sync addon every few days to be able to use a switch
Not that it can't be done, but I believe you will have a better experience with headless Chrome under Ubuntu. You specify access to folders in the addon config.
but how do I run that within the action
I'm trying to use Github codespaces with the HA devcontainer, but I get a 400: Bad Request. Did anybody get this working?
works for me
Did you do anything else with the add-on devcontainer image? I have this: https://github.com/TECH7Fox/asterisk-hass-addons/tree/main/.devcontainer
Guessing it has something to do with the gh codespace proxy right?
did you do anything to customize this container?
yeaaaaa... wasted 4 hours yesterday
Only added hadolint. Here is my dockerfile:
FROM ghcr.io/home-assistant/devcontainer:addons
# Install Hadolint
# hadolint ignore=DL3022
COPY --from=ghcr.io/hadolint/hadolint:latest /bin/hadolint /usr/local/bin/hadolint
did you test the devcontiner locally?
I tried to, but my docker with WSL2 is extremely slow for some reason. Just ls takes 2 minutes.
I guess I could give it a shot
Would appreciate it! 🙂
Here is my repo: https://github.com/TECH7Fox/asterisk-hass-addons
Wanted to test some new features, but my raspberry pi doesn't like building the new image.
well... it works for me on my ubuntu server
the devcontainer built and I am in it
Hmm.. Then it is probably the proxy of the Github codespace right?
someone might have a example for building amd64 and aarch64 container?
e.g. && sh -c 'echo "deb [arch=$ARCH_I_WANT_TO_BUILD] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
even after adding that I get the same error
mhmm, cou could try to add it in the homedir git config
~ ❯ cat ~/.gitconfig
[user]
name = Underknowledge
email = blackhole@underknowledge.cc
how do I do that within an action
I would cat EOF
cat <<EOF > ~/.gitconfig
[user]
name = Underknowledge
email = blackhole@underknowledge.cc
EOF
the thing is, I really don't know why this is happening to begin with
I get this in the HA observer: https://tech7fox-asterisk-hass-addons-p9q4j9r427g4g-4357.githubpreview.dev/
I shouldn't have to git config because I have the token but the commit command the python script runs requires an email
can you share where youre stuck?
I don't think I can view that
It's set to public. But it does take a second to load for me.
I get a GitHub 404 because its your codespace
What a thing. is it possible that you dont have a public mail for github?
For port 8123, which is HA itself, I get 400: Bad Request. https://tech7fox-asterisk-hass-addons-p9q4j9r427g4g-8123.githubpreview.dev/
yep that is correct I have it hidden but that bug should have been solved
Weird. I can see it on my other device without github account.
oh this link I can
but its a 400
Yeah, that's what I get too.
I would say that it would be odd that you can expose ports in dev machines
wth, they let you do that 😄
It's great to test. I can see the HA observer, so that part works I guess.
I should use something like this too. I only have 20Mbits here :/
I've been really meaning to sit down and work on creating a add-on to give me a Starlink dashboard via egress.
It's the one thing I've been missing
I bet you sit already, step 2 now
I just got in the codespace beta, so testing it out. It would be great to have a HA test setup in the cloud. 🙂
haha not wrong.
Hidden username? #6 hast a test script
this is the exact full error https://www.toptal.com/developers/hastebin/eyurowipag.csharp
seems github actions uses its own username and email
I mean it seems like it has to do with the email based on the log output which could be triggering that maybe
maybe try to set a env var
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
GIT_AUTHOR_EMAIL or GIT_COMMITTER_EMAILand see if the error changes
adding the email fixed it!!!!
env:
EMAIL:
it seems to have reformatted my changelog however
🎉
fyi afaik it doesnt have to be a real mail
just like with GPG
Someone has a node addon already (Where I can steal the install steps )
Currently setting up shema and options. are these set in the container globaly as env vars? or do I have to interfer with bashio to get these vars out?
well, I ll soon find out, trying both
just asking me if run lets me export variables
duh, there you go the extra step to drop privileges...
s6-overlay-suexec: fatal: unable to setgid to root: Operation not permitted
Can I somehow run software as user with s6? I get it that the init process want/need it, but afterwards
if i map config:rw in my config.yaml can i access it from docker build actions? So if during a build i want to copy stuff to from inside the docker image to the /config/mysettinshere/ folder in the /config with e.g.: RUN mv command should that work? I can't get it to work i am beginning to think it doesn't
i 'fixed' it in entrypoint.sh
Trying to build a new addon for the extension I have built, however because my docker build takes a while as it is pip installing a few packages the addon fails to install locally. I can docker build it locally. Is there a timeout value I can increase in the config.yaml for build time?
No, CI have a fix limit of 6h
@woeful otter please have a short look at https://github.com/home-assistant/addons/issues/2527. it’s a very small correction.
@grave veldt Sorry, I'm enjoying my private sunday evening
in general, please don't ping for reviews 👍
oh it isn't even a review (don't ping for that either :D)
Ouch. did not want to disturb. I wish you a nice Sunday evening. that will not happen again.
Don't worry m8 👍
So I have built a repo with the addon, seems to be working fine for me. https://github.com/PetHubLocal/addon I assume it's probably just easier to stick with that as all I need to do now is add the new repo and it all just works. That all works really well, my only feedback is it would be great if the docker build output was sent somewhere as I found the best way to build and test was to spin up the HAOS as a VM on my desktop machine and then via the CLI do the docker build locally and rinse and repeat it until I fixed all the bugs
I am building my first custom addon, and it works within the devcontainer, but fails to start on my real Home Assistant instance due to permissions errors within the container. While troubleshooting, I modified my /etc/services.d/nginx/run file to include both whoami and ls -la /var/lib/nginx. In both cases the current user is root, but in the devcontainer it can list the files properly, and in my real Home Assistant instance it gets ls: can't open '/var/lib/nginx': Permission denied. I'm struggling to figure out what could cause the permissions inside the container to be different depending on where the addon is installed. If this matters, my real Home Assistant runs the ova release of hassos.
Is there a way to access the container build output from the supervisor? I'm not sure if maybe something is failing during the build that I'm just not seeing
Some software also allows you to put a user in the config file and drops privileges itself, like nginx: https://github.com/mdegat01/addon-loki/blob/main/loki/rootfs/etc/nginx/nginx.conf#L5
Thanks! In my case, however, nginx is running as root, it is even specified in the nginx.conf file that way. My issue is the opposite--root should have full privileges and yet is receiving an error. I've tried rebuilding the container about 50 times at this point, and it's broken every time on my home server, while it works every time in the devcontainer
My plan next is to try and get my image builds working right so I can make sure I'm using the exact same container images everywhere. If it's not a difference in containers, then I'm at a loss as to why the exact same addon code could have a permissions issue on my real HA instance but not in the devcontainer HA instance
That was actually part of a reply to underknowledge. But looking at yours, do those folders exist? I had to make them in my dockerfile: https://github.com/mdegat01/addon-loki/blob/main/loki/Dockerfile#L44-L53
I think nginx makes them if they don't exist but if you're trying to access them in the run script then that's before nginx has started
Oh, sorry to butt in, it sounded relevant hah. I think I should get a different error than permission denied when running an ls if the folder didn't exist though, and I still can't seem to reconcile how it works properly in my devcontainer, I feel like the image should work consistently, but I must be missing something. If I take my ls out of the run file, then nginx itself gets permission denied trying to write to its log file, still only when installed in my real HA
Do you have an apparmor profile for your addon by any chance?
I do, I have the one from the example addon repo with the addition of trying to add /var/lib/nginx/** in rw mode but that didn't have an effect. I tried removing the file and even setting apparmor to false in the config file as well, but it didn't seem to matter unless maybe I did it wrong
Ah
Yea that only grants permission to stuff in the folder
But can't list the contents of the folder with that
I also added /var/lib/nginx without the wildcards after it but it didn't make a difference. And I have the same apparmor file in place when it works properly in the devcontainer too, so I'm not sure what could make it work differently with the same Dockerfile and addon code
Change it to this
/var/lib/nginx/{,**}
If you look at mine you'll see I do that all the time: https://github.com/mdegat01/addon-loki/blob/main/loki/apparmor.txt
Ok done, so that combined both my rules into one which is good, but I think the behavior would still be the same as specifying it on two lines wouldn't it?
And that explains the difference, devcontainer does not use the apparmor profile cause it cant
Ohh, I didn't realize that
Gotcha, I may have missed that end slash. Ok, I'll give this a try. I'm skeptical since it still didn't work with apparmor fully disabled, but maybe that change didn't take effect for some reason
I am pretty new to apparmor, looking at your file you have a main loki profile, and under that you have loki and nginx profiles. Maybe I am missing using the right profile names
I see how your file is set up now referencing the program executables. I need to fix my apparmor.txt file I think
Yea I send each service to its own profile here: https://github.com/mdegat01/addon-loki/blob/c56e0fb62b803b86f086d725f730acf169e61f9e/loki/apparmor.txt#L69
You can also just use ix for now to allow it to execute with the same profile and then split out later
Does the main profile have to have the same name as the addon? And would I just change cx to ix and then put the rules in the parent profile if I wanted to split it out later?
Yes the main profile must have the same name as the addon. That actually won't be its name at runtime either, it'll be the addon slug
ix means execute allowed and use the same profile. That's why you see it here for everything in /bin: https://github.com/mdegat01/addon-loki/blob/c56e0fb62b803b86f086d725f730acf169e61f9e/loki/apparmor.txt#L37
cx means execute allowed and use a different profile. By default it will look for a child profile with the same name as the file. Or you can direct it to a specific one with the arrow like I did
Oh nice, ok cool. It seems like you have set me on the right track, even though I could have sworn I disabled apparmor fully and tried it, this does seem like it explains the behavior I'm seeing now. I really appreciate your assistance!
And also shows that my apparmor changes to add /var/lib/nginx before would have had no effect because they were in a profile still named example 🤦♂️
Ah. Yea I don't think that goes well. Possibly the name at the top doesn't matter at all and just gets replaced with the slug but I thought it had to be the addon name
When I'm developing a local addon and make a change in the code, for example changing the apparmor profile here, is it sufficient to just click Stop, Rebuild, and Start, or do I need to do something more like restart HA first?
Neither actually. When developing a local addon to make a change in the apparmor profile or in the config.yaml you have to either uninstall and reinstall the addon or increase the version so it asks you to update
Rebuild rebuilds the image from the dockerfile
So all the stuff outside of the image is unchanged
Oh, I forgot the apparmor file didn't end up in the image, that makes sense. But uninstalling and reinstalling is always sufficient to see changes then?
Yes that'll work
Thank you! I've been doing a little dance and restarting HA each time I make a change because I've been confused about whether it's actually seeing my changes or not
But, now the reason it wasn't seeing my changes is much clearer heh
I should write a guide on the apparmor dev at some point, I've had it on my list. But a tip for it. What I usually do is put the profile in complain mode (see https://gitlab.com/apparmor/apparmor/-/wikis/AppArmor_Core_Policy_Reference#profile-flags) and then watch the auditd log
Then just add all the things that come up
Oh yeah, I just read that section of the example file too now that you mention it, that is really cool!
Huh, so I'm closer now, but I just see "Starting Nginx..." and then "Nginx stopped, restarting..." over and over again so now I must have a different issue
I'm guessing still an apparmor issue, though, since it still works in the devcontainer
Maybe complain mode is what I need now? Where do I run the journalctl command to view the output of that, in an HA SSH session, or is that run in the container itself?
Yea probably. That's how s6 handles a crash in the service, just keeps restarting it unless you tell it a crash should bring down the container
Well there's two options, it's actually neither of those lol
Oh haha
One is host ssh, other is copying the files to a debian system. Ssh addons are alpine so they can see the files but not really read from them easily
I wrote a guide on it here actually: https://community.home-assistant.io/t/how-to-get-to-your-log-after-restart-restore/387662
Different topic, same problem
Oh, thanks! Reading now
I recently built a new addon and found the best way to test the build was running a local HAOS VM and doing the docker build from the command line.
--build-arg BUILD_FROM="homeassistant/amd64-base:latest" \
-t local/my-test-addon \
.```
The other thing that really caught me out was finding somewhere to store persistent config that could be accessed by the end user, which eventually I dumped in /share/myaddonname and then made sure I mounted the share filesystem rw in the config.yaml
map:
- share:rw
https://github.com/PetHubLocal/addon is my addon if you are interested
You prefer that to testing in a devcontainer, or you do that after you have used the devcontainer and before you install it on a real HA instance?
I just did all my build on a real HAOS VM as I have VMWare for other dev work I do so I just spun up the HAOS VMDK, then I could mount to the addons share and directly edited the files on the share.
then on the command line in HAOS I ran the docker build, made sure it all built fine, then installed the addon using the UI.
Once it all worked I just copied it off the VM, and committed the code
It may seem a bit around about way of doing .. but it just meant that I didn't run into any weirdness with the image I built and I knew it actually worked
I'm really loving the devcontainer workflow so far, I get the docker build output right in the vscode output pane and there is practically no setup involved. But the one downside I've found so far is that it doesn't test apparmor that way apparently, so your method might be better for that
WAIT as it can take up to 7 minutes for the add-on to deploy as it needs to download the Home Assistant Docker image, install OS packages and PIP install all the python packages. It takes a while so just get a coffee or something rather than navigating away from the install screen.
You can avoid this by building and publishing the image to dockerhub, ghcr or some other container repo and then listing the url in image in config.yaml
Plus then backups won't include the image and be huge
Yeah I was being lazy and I could build the full image on a x64 platform in 30 seconds or so, was pip installing packages so building an image didn't really save me much.
It's just the Odroid C2 that took 7 minutes to build... yeah I should probably publish images somewhere, but my project is still in a bit of state of flux, so didn't want to go to that effort when only a few folks are using it and any changes require a full rebuild of the image
I just have CI build and publish it
My addon is running in my full HA instance now, thanks for the apparmor assist @pallid isle!
Borrowed from frenck
Has a poke into https://github.com/mdegat01/addon-loki/tree/main/.github.... ok then 🙂
To be clear, I claim zero credit for that lol. Take a look at any of the addons in the community addons repo, you'll notice it's almost identical lol
I'm trying to connect to a web service running on my physical home server from a PHP application in my addon and it gives me connection errors, while the same code on another host in my network, not running inside a HA addon, can connect to the web service just fine. Are there any special considerations when trying to communicate with other network addresses outside of HA?
I couldn't find info about this in the documentation, which makes me think perhaps I'm asking the wrong questions, or my application is just misbehaving and it has nothing to do with running inside an HA addon container
So before I get too far into the weeds troubleshooting the application itself, which does work fine in a different docker container (just not as an HA addon), I want to make sure I'm not missing something more basic
Normally no however in this case, did you add network access to your apparmor profile? Like this in mine: https://github.com/mdegat01/addon-loki/blob/main/loki/apparmor.txt#L78-L81
Probably don't need all of that, Loki and promtail communicate in more complicated ways then usual. But definitely need at least network tcp
I did not, I am betting that's it! Thanks for the tip!
You probably need network udp too actually since DNS uses that and I would guess youre accessing your webservice by a resolved hostname and not by ip address
I at least want to support using hostname or IP address in the configuration so I probably do want that too
It still didn't work, but thinking it through further, since apparmor doesn't work in the devcontainer anyway then I must be having some other issue
(as I can't connect to my network service from my addon in the devcontainer either)
I'm betting I need to keep the apparmor change too though
Strange. I've never had to do anything special for network access other then in the apparmor profile. If the source code is available somewhere I can take a look if you drop a link
Sure, that would be amazing! I pushed my latest code here: https://github.com/bmcclure/ha-phpvirtualbox-addon
It may not be a network access issue, phpvirtualbox is just very vague about what the issue actually is when it can't connect to the server for any reason. I have another separate docker container I'm hosting on my server which has the same version of phpVirtualbox in it, with the same configuration I'm using, and that one works however
Hoping maybe you spot something obvious I've missed heh. I did change the user nginx is running as to "nginx", because I realized I had already configured php-fpm to run as that user. The addon still works after I did that, so that's good, but it didn't affect my connectivity issue
One significant difference between my working Docker container and this one, other than this one being an HA addon, is that the one that works is running PHP 5.6. However I've read in several places that phpVirtualBox works fine on PHP 7.4 and that's what my HA addon container is running
So nothing really jumps out at me tbh. I guess the only thing is where actually is the php-fpm binary? It's somewhere in the path obviously since you call it without an absolute reference but just make sure it's somewhere you have granted executable access to in the apparmor profile
That shouldn't break since it's in complain mode but will when not in complain mode. Also you may find it's logging a ton even in complain mode if it's not somewhere with executable access
I was wondering where the binary is, I got that code from one of the community addons and it didn't use the absolute path to php-fpm either. I will try and figure that out, I suppose the apparmor logs from complain might tell me
Yea it'll be in there a lot if it doesn't have executable permission since then literally everything it does will have a permission error
If you can go into the container just do which php-fpm
Can you ssh into an addon container?
No but if you have access to the docker cli (either via host ssh or community ssh addon with protected mode off) can do docker exec -it addon_<addon slug> bash
Oh or in devcontainer, duh
Easier there lol, forgot that
Oh yeah, that was easy! /usr/sbin/php-fpm7 apparently
I've added it to my apparmor file now at least. Thank you for taking a look at the code!
I will keep troubleshooting the connection issue. I feel like it's so close to working
When you docker exec into your container you should be able to curl to the endpoint. Assuming curl is installed.
Hi everyone, I'm trying to get a simple testing addon to run, however when I start it the log only shows s6-overlay-suexec: fatal: can only run as pid 1. What can be the cause?
Thanks
🤔 I don't recognise the rootfs/etc/service.d path, is there any documentation for using it in addons?
@sonic wigeon It means you haven't set init: false in your add-on config
our base images use the S6 Overlay as the init system, thus you'd have to disable dockers init 😄
let me double check; I believe I set it already to false
Welp, it wasn't 🤦♂️
Any idea why after adding
map:
- config:rw
to the config.yaml, and reinstalling the addon, I can't see the directory through the addon?
Hey... I'm looking at developing an addon where the configuration parameters will include a certificate and private key file. What kind of configuration for those makes sense? A "string" seems like kind of a clumsy way to do it (leaving aside that multiline strings are going to be pretty ugly in the UI).
I'm tempted to have a certificate file uploaded into config for this, but I'm a bit leery, because these files are effectively credentials and I'm not sure that's the safest place to put them.
Hi, is this the right channel to ask about a custom_integration using bluetooth?
I'm running my addon locally using docker run --rm -it -v (pwd):/data -v (pwd)/test/config:/config local/iot_certbot /bin/bash ... where (pwd) contains an options.json that has values I want to test my addon with. However, bashio::config is not finding my config file. How do I provide a local configuration file for local addon testing? (ignore the (pwd) instead of $(pwd); this is fish shell, not bash, on the outside)
So, this, I solved by putting my config at the location bashio uses for caches... it worked. It's ugly, but it works 😄
Hi all 🙂 I hope this is proper channel. I created custom component which extend mqtt cover, by creating new platform. So it worked with "mqtt: - platform "mqtt_somfy". But I have no idea how to do it, for new style configuration, where it should be "mqtt_somfy: cover: -name ...". The custom component must be based on mqtt component to not create another mqtt client connection (so cannot copy and modify the mqtt component). So is there any "example" component, which is extension of existing component, where I can get inspiration please? Thanks and have nice weekend.
Hi all!
Question about config_flow: is there any way to display a "warning" or "info" messages in the forms? For the moment I am just using the "errors" parameter, but the message is rendered in RED. I was expecting to have the same exact thing but with warn/info UX (yellow/blue background)
@worldly rock Wrong channel 🙂 #devs_core-archived
The errors param is the way to go
there is no other message type
Hi @woeful otter you're right, that's for integrations, sorry for misusing this channel. BTW point taken, I'll keep using the errors param. Thanks!
Hi there! I was thinking of creating a simple syslog log exporter addon to send logs over TCP/UDP to a standard syslog receiver. I started down the path of writing this a few months ago and never finished it. In the meantime it appears there are a few plugins that do this already, but for things like ELK and PLG (Promtail, https://community.home-assistant.io/t/home-assistant-add-on-promtail/293732)
Does this sound like something that would be useful, or is anyone already working on this already?
hey, i'm co-developing a new AddOn (Teams Presence Bridge): https://github.com/youseeus/teamsPresenceBridge
unfortunately the addOn isn't showing when i'm adding the repository. Can anyone help?
Just imported your repository, and i got this in my logs: 22-07-05 20:18:07 WARNING (SyncWorker_7) [supervisor.store.data] Can't read /data/addons/git/05762135/teamsPresenceBridge/src/config.yaml: Invalid Add-on config!. Got {'azureApplicationId': '<applicationId>', 'azureClientKey': '<clientKey>', 'azureTenantId': '<tenantId>'}
also this: 22-07-05 20:18:07 WARNING (SyncWorker_7) [supervisor.store.data] Can't read /data/addons/git/05762135/teamsPresenceBridge/config.yaml: does not match regular expression ^([a-zA-Z\-\.:\d{}]+/)*?([\-\w{}]+)/([\-\w{}]+)$ for dictionary value @ data['image']. Got 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Microsoft_Office_Teams_%282018%E2%80%93present%29.svg/258px-Microsoft_Office_Teams_%282018%E2%80%93present%29.svg.png'
why i'm not getting those logs...
Its in the supervisor logs.
you might not have selected the supervisor tab on the top
now its working fine. 🙂
Hey! I have an addon since quite some time, and I communicate with home assistant through the websocket.
It stopped working a couple of days ago and I don't know why.
I get a {'type': 'auth_invalid', 'message': 'Invalid access token or password'}
The token is correct because I can do curl -X GET -H "Authorization: Bearer ${SUPERVISOR_TOKEN}" -H "Content-Type: application/json" http://supervisor/core/api/config
The code is here: https://github.com/agileek/hassio-addons/blob/master/signal/root/app/ws.py
it has not changed since march 2020, so I assume this is something deprecated that I did not see anything in the documentation 😦
Do I have to add hassio_api: true in my config? I don't understand the difference with home_assistant_api: true
should work
hassio_api is for supervisor access and home_assistant_api for core access
you should see your access on the su logs
I added hassio_api: true https://github.com/agileek/hassio-addons/blob/master/signal/config.json and I still get the same error
Actually, the message is a little bit different:
INFO - Sending message to ws://supervisor/core/websocket
2022-07-06 12:14:30,437 - root - ERROR - could not authenticate with home assistant {'type': 'auth_invalid', 'message': 'Invalid access'}
feels like an issue with your access token
The access token is automatically generated right? I don't have to do anything?
Do I have a way to force-renew this token? I retrieve it via the env variable SUPERVISOR_TOKEN (there is an HASSIO_TOKEN env too, but they have the same value
Hey Guys, I'm trying to test my add-on locally via SMB and followed all the steps detailed here: https://developers.home-assistant.io/docs/add-ons/tutorial#i-dont-see-my-add-on. But my add on doesn't show up. I've also checked the supervisor logs but it doesn't report any error. Any ideas what could be going wrong?
I am troubleshooting an addon that fails to add any entities on some systems. The code basically does this:
hass, config, async_add_entities, discovery_info=None):
try:
...
async with async_timeout.timeout(10):
response = await session.get(url)
info = await response.text()
...
except Exception as error:
...```
If I understood the Python async stuff correctly, this code basically adds a call to get() into the async queue, and then does the same for the text() call. Since this is run on startup, it may very well take more than 10 seconds before it they get a chance to get executed, triggering the timeout.
So, what is the proper way of coding this? The actual name of the sensor is extracted from info so it needs to be run before we can call async_add_entities(...).
Is it OK just to remove the timeout line?
I recently created a new add-on and found that while the repository was successfully loaded the add-on (only one) was not listed; I then enabled Advanced Mode in the user profile and returned to the App Store and found the add-on listed;** is this expected behavior?** When I disable Advanced Mode the add-on is not listed.
That is one of the properties that can be set for an addon. The SSH addons behave that way, for instance
What is the property?
I just did a Google search
Looks like:
advanced bool false Set this to true to require the user to have enabled "Advanced" mode for it to show.
It must default to true
Yes, reading it now; there must be another condition
I do not have "advanced" in my config.json
Ah-ha! Due to "experimental" status
Thank you for the pointer; I had forgotten to check that page; my Google search was not as successful as your 🙂
Just updated the supervisor and core and am now receiving "This add-on does not expose configuration for you to mess with…" for my add-on; any help?
Getting "22-07-07 17:22:07 WARNING (MainThread) [supervisor.ingress] Fails Ingress panel for edf7ba55_ageathome with 500
" in the supervisor logs
@buoyant needle posted a code wall, it is moved here --> https://hastebin.com/uvolatimod
Hello, little update on #devs_add-ons-archived message
I tried to add every config that I felt could be related to the issue:"homeassistant_api", "hassio_api", "hassio_role": "homeassistant"
And the websocket still responds with 'Invalid access'
I'm really stuck here, this worked for a couple of years, so I assume something is deprecated now, but I can't see why, and I don't see anything in the logs.
I connect to the websocket, then sends a payload
{ "type": "auth", "access_token": os.environ.get("SUPERVISOR_TOKEN")}
That's what the documentation tells me to do. Is there anything I'm missing?
yeah, that is how it should work
but only if the auth provider homeassistant is used
I only have this in the configuration: component=config.auth && component=config.auth_provider_homeassistant
my configuration only has homeassistant as the auth_provider 😦
Somebody knows another addon that uses the websocket so I can see what I do differently? It's not related to my setup, it affects many (all?) users of the addon
Ok, I found something, os.environ.get("SUPERVISOR_TOKEN") return null, even though when I'm in the docker container, echo $SUPERVISOR_TOKEN returns the token.
Seems like some python asyncio problem rather than related to the addon, for those having the same problems, I'll continue to investigate in the addon issue: https://github.com/agileek/hassio-addons/issues/42
Hi, is there a good sample pre-configured/example addon container that has a working django python app and mqtt interface? I'm struggling either configuring nginx or uWSGI well
My add-on (https://github.com/ageathome/addons/tree/master/ageathome) is working just fine, but sometimes when I install it I am given the option for auto-update and sometimes I am not given the option to specify auto-update for the addon; does anyone know of a reason why this might be the case?
Could it be that "Advanced Mode" needs to be turned on?
Yup; you have to have "Advanced Mode" enabled
I'm creating an addon (https://github.com/wouterdebie/homeassistant-addons/tree/main/uhppote-mqtt), but for some reason s6 gives me the error s6-supervise uhppote-mqtt (child): fatal: unable to exec run: Permission denied. The binary in the image is there, has the right perms (755) and did execute when I used CMD in my Dockerfile (but that doesn't setup the correct env stuff, so I switched to s6). Anybody have an idea what is up?
Sounds like you haven't set the executable bit on these files: https://github.com/wouterdebie/homeassistant-addons/tree/main/uhppote-mqtt/rootfs/etc/services.d/uhppote-mqtt
Ah! 🙂 Thanks!
that helped 🙂 One thing I'm running into is that http://supervisor gives me a dns lookup error...
I have the following in my config.yaml, but I can't seem to talk to lookup supervisor from my application:
services:
- mqtt:need
hassio_api: true
hassio_role: default
homeassistant_api: true
http://supervisor should always be there, regardless of config
Have you tried entering your container and see if you could resolve it from the console?
how do I enter the container in hassio?
using docker? (as in, that is the answer :D)
ssh to the host and then docker into the container you mean?
yup
ok, let me enable host ssh first.. is there an option, or is that still a bit of work?
You don't need host SSH for that
The community SSH & Terminal add-on could be useful for debugging
it has the docker CLI
oooh
@woeful otter I had to apk add docker, since it wasn't there.. and now I can't run docker ps: ssh root@hassio.local -p 22222
how do i configure z2m in the new os8.3?
or where may i ask?
i always get "no need to configure"...
The community ssh add-on...
gotcha
#add-ons-archived For support 👍
found it.. dankjewel
np
Fun.. turns out some Rust libs use getaddrinfo(), which sometimes fails in Docker containers..
Seems like it has something to do with a combination of Alpine and musl
should i be able to add a user to ssh addon?
i have setup keys but when i try to remotely login get access denied and then i get unkown user
is this the right place to ask this?
Nope, support goes in #add-ons-archived
For discussion on the development of add-ons (not integrations - for that see #devs_core)
https://developers.home-assistant.io/docs/add-ons
thanks moving there
Is anyone using the Code Notary (codenotary.com) capabilities in conjunction with add-ons? I read the documentation and apparently there is a build.yaml file (which I have not used; I use build.json to specify FROM images); any help? I signed my Docker container, but the cas program on my Mac only generated amd64 SBOM even tho' aarch64 and armv7 are in the multi-arch manifest