#devs_add-ons-archived

1 messages · Page 6 of 1

queen cloak
#

hi when I had a second device in my tuya account and link to ha the first disappear... Which is the right way to add two different device under tuya and ha ?

earnest bridge
#

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?

high thorn
#

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?

astral briar
#

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

queen cloak
odd umbra
#

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)

high thorn
#

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

astral briar
#

/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

shy torrent
#

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.

cedar carbon
#

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

mental wagon
#

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

upbeat oyster
#

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?

crude shale
#

if so use COPY

upbeat oyster
# crude shale so you are not mounting the folder correct? you just want to copy it into the co...

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.

crude shale
upbeat oyster
# crude shale 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)

crude shale
upbeat oyster
#

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.

crude shale
#

Line 14

crude shale
upbeat oyster
# crude shale 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.

crude shale
#

I don’t see the space on my side

#

I will try it in a bit when I get home

upbeat oyster
#

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.

gusty escarp
#

If it doesn't change, don't persist it....

crude shale
#

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?

cedar carbon
#

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

vague olive
#

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.

upbeat oyster
astral briar
#

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

fervent sapphire
rigid shard
#

/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

fervent sapphire
nova radish
#

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

woeful otter
nova radish
fresh tulip
#

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

rigid shard
neat obsidian
#

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!

lethal eagle
#

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

icy maple
#

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

unique scroll
#

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!

astral briar
#

"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?

unique scroll
#

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.

unique scroll
unique scroll
astral briar
#

the docker multiarch is not that smart, you have to use our solution

unique scroll
#

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

unique scroll
glacial trail
#

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.

astral briar
#

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

glacial trail
glacial trail
astral briar
#

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

valid thorn
#

can the vscode remote container for addon development be used on an M1 mac?

astral briar
#

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

rigid shard
#

If you find away to modify how it runs it to add --platform linux/amd64 it should work

deft salmon
#

Anyone able to help me run the Tuya WebRTC demo on mac?

#

Trying to pull rtsp stream from my door cam

wanton spruce
#

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?

cloud basalt
#

An integration, not an addon

wanton spruce
#

corrected. so what's the answer?

cloud basalt
#

I have no idea

rough wraith
#

is there a sample integration of a simple sensor anywhere?

cloud basalt
weary oxide
#

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

safe monolithBOT
weary oxide
crude shale
#

looks fine on first glance

crude shale
weary oxide
#

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 🙂

crude shale
wary spade
#

Hi Is anyone available to help with a question on a creating a new Addon?

wary spade
#

Is anyone available?

astral briar
#

looking into our test add-on

#

with s6

#

(we should once update the docs and ride out all with the old run.sh)

mellow plank
#

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".

safe monolithBOT
#
The topic of this channel is:

For discussion on the development of add-ons (not integrations - for that see #devs_core)

narrow eagle
#

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?

cloud basalt
#

Or the community addons server, if you're using that addon

narrow eagle
#

I will try that, thanks @cloud basalt .

high thorn
#

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?

keen yew
#

what could cause my /data/options.json to be an empty object? I have defaults defined.

gusty escarp
cloud basalt
#

whoa

#

addons don't belong in custom_components

keen yew
bright ingot
#

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?

bright ingot
#

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 😄

astral briar
#

"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

upbeat oyster
#

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.

keen yew
#

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"?

cloud basalt
#

Yes, it was replaced with 'check for updates'

keen yew
#

nice

#

you did that fast!

rigid shard
#

search + replace 😄

weary oxide
#

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.

woeful otter
weary oxide
#

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.

woeful otter
#

You can't run dynamic things in a static configuration file

#

so, you can't add it config.yaml

weary oxide
#

yep, that's what I thought.
Fine, thanks again 🙂

turbid adder
rigid shard
covert current
coarse hare
#

Does any one have the time to review a single character pull request? 😂

#

And it's an invisible character at that...

turbid adder
#

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.

rigid shard
#

Addons should never create entities, that is a job for integrations

astral briar
#

addons run software & integration doing the core part

turbid adder
#

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

rigid shard
#

yes

turbid adder
#

Okay, i'll do some digging into how they should communicate

astral briar
bright ingot
#

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"?

orchid crater
#

MQTT discovery will make it easier for everyone.

#

It's pretty much the Home Assistant API.

bright ingot
#

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 😄

hexed charm
#

anyone doing amcrest2mqtt?

#

specifically with multiple devices

weary oxide
#

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 ?

sturdy estuary
#

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

weary oxide
cedar carbon
#

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...

warm tiger
#

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.

cedar carbon
#

@warm tiger Ahh, makes sense, none of my add-ons have the image property set. Thanks a lot for the help!

clear oak
#

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?

rigid shard
#

which documentation?

clear oak
clear oak
#

Ok yaml it is

rigid shard
#

YAML is generally more readable by humans

clear oak
#

it has it own quirks but is more readable by humans indeed

fair sonnet
#

I feel like I am missing something obvious

cloud basalt
#

I can add it without a problem

fair sonnet
#

I keep getting this:

#

weird, I guess it was a companion app issue, doing it through the browser worked

#

thanks

faint forum
#

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.

#

Thanks!

upbeat oyster
# turbid adder Fairly basic question: What is the best way for an addon to create an entity and...

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.

orchid harbor
#

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

cloud basalt
proven mortar
#

Hey, is there any docs for how to start with add-on development?

rigid shard
proven mortar
#

Thx!

proven mortar
#

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...

zinc osprey
proven mortar
faint forum
#

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

proven mortar
#

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

crude shale
#

Got unexpected response from the API: No access to mqtt service!

#

but I have ```yaml
services:

  • mqtt:want
gusty escarp
#

Would change to need

#

Assuming it is required

crude shale
#

seems to work

gusty escarp
#

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

crude shale
#

I want them to be able to manually set mqtt if they need to

crude shale
#

that was odd, it was just the fact that mqtt wasn't quoted but my other addon seems to work but its not quoted

rare brook
#

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?

faint forum
proven mortar
faint forum
# proven mortar Sure that it does it already with the initial requst? Or is [host]:10443 is red...

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```
proven mortar
#

/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

faint forum
#

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?

proven mortar
#

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

faint forum
#

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

amber mist
#

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?

rigid shard
amber mist
#

Thx for the info, any workarounds till it is fixed? @rigid shard

rigid shard
#

Change L119 in /ets/supervisor_scripts/common from -e SUPERVISOR_MACHINE="qemu${QEMU_ARCH}" \ to -e SUPERVISOR_MACHINE="qemux86-64" \

amber mist
#

OK, where do I find the file?

rigid shard
#

/ets/supervisor_scripts/common is the file?

amber mist
#

Al I have is a .devcaontainer.json file and the folder of my add-on I am gonna build

rigid shard
#

okey, then you wait untill fix has been merged

#

And you pull a new image after it's built

amber mist
#

Ah U mean in the devcontainer ... repo ... you mean to build my own based on the official with the suggested change

rigid shard
#

no

amber mist
#

So why is it that hard to explain where to find the file /ets/supervisor_scripts/common?

amber mist
#

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

wind herald
#

Easiest:

  • remove the mkdir
  • do the cd to /usr/local/bin
weary oxide
#

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.

weary oxide
#

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 ?

amber mist
#

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?

woeful otter
#

There are 6 possibles shares you can get mounted: config, ssl, addons, backups, media and share

amber mist
#

Awesome, thanks a lot

magic fjord
#

Hello, is there a possibility to install addon from a repository branch or use branch as a beta release or something like old-stable?

barren frost
#

Hey all - I'm having issues with custom components since today's update. Am I in the right place to report the issue?

safe monolithBOT
loud canyon
#

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

high thorn
safe monolithBOT
austere torrent
#

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
safe monolithBOT
austere torrent
#

Any idea how I can make sure to have the equivalent of --privileged -v /var/run/dbus:/var/run/dbus?

Thanks!

stone stone
#

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?

cloud basalt
stone stone
#

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.

cloud basalt
#

/addons

stone stone
#

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

magic fjord
#

Hi, what is the best option to send error messages from device over mqtt?

sinful cradle
wispy jewel
#

I want to develop my addone Very difficult

clear oak
#

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? 😇

summer urchin
#

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 ?

cloud basalt
safe monolithBOT
summer urchin
#

@cloud basalt got it working after adding the add-on under a new name. Thanks for the link.

hexed charm
#

Studio code server causing high cpu/memory leak - wondering if anyone has seen this in their setup

cloud basalt
hexed charm
#

This the wrong channel for this question?

cloud basalt
#

Yes

safe monolithBOT
stiff saffron
#

Question: wasn't usb: true supposed to automount --device /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, etc?

astral briar
#

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

stiff saffron
#

@astral briar got it. Thank you so much!!!

pseudo trail
#

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?

nocturne pivot
#

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

high thorn
#

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...

nocturne pivot
nocturne pivot
high thorn
nocturne pivot
#

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]

high thorn
#

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

nocturne pivot
#

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

high thorn
unique scroll
#

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!

lean pivot
#

promtail

cloud citrus
#

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

turbid geyser
#

Does it need mqtt?

coarse hare
#

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.

woeful otter
coarse hare
#

OK sorry

unique scroll
unique scroll
#

Is there a place to request this feature (custom ingress url through addon config.json) ?

woeful parrot
#

Is support for Apple Home key comming to HomeKit addon?

unique scroll
near sinew
#

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?

warm tiger
#

Is it python or python3 that's included? Also, you defined the base image correctly everywhere? Is your code online, helps to check.

safe monolithBOT
near sinew
#

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

near sinew
#

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"]
cloud basalt
#

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"

near sinew
#

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

near sinew
#

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

near sinew
#

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

near sinew
#

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.

near sinew
woeful otter
#

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)

near sinew
#

Nice one. Thanks @woeful otter

near sinew
#

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

unborn umbra
#

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

unborn umbra
#

oh man, turns out my NUC doesn't even have BT built in lmao

#

time for a dongle

pine summit
calm wing
rancid breach
rancid breach
#

Any feedback would be appreciated, 😸

manic ibex
#

Where are python packages that custom_components depend on in the home assistant docker container?

cloud basalt
#

/usr/local/lib/python... I believe

#

Unrelated to addons

elfin wigeon
#

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

elfin wigeon
#

I also have an optional device? option, which is not treated as optional

elfin wigeon
#

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

elfin wigeon
#

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?"
elfin wigeon
#

ah, since shares is associative, it's the third level?

unique scroll
# elfin wigeon I read that, and it says `If you want make an option optional, put ? to the end ...

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!

elfin wigeon
#

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

unique scroll
#

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.

hidden haven
#

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?

crude shale
#

does anyone have a good example for setting up cas with the builder

unique scroll
# crude shale 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.

  1. I've added CAS_API_KEY to my github environnement secret. The environnement is called CR_PAT in my example.
  2. I've added the signature owner in both build.json and config.json (ex : https://github.com/alexbelgium/hassio-addons/tree/master/webtop_kde).
  3. 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

wind sequoia
#

no ikea air purifier and ikea shortcut button availiable to deconz wia conbee II?

pure saffron
#

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

pure saffron
woeful otter
#

Yes I know

#

I meant

#

"mowing" is not a valid state

#

so it cannot be used

pure saffron
#

Ok thanks 🙂

#

another and last question 🙂

Is it possible to have trigger when vacuum is in state "STATE_ERROR" and "STATE_RETURNING" ?

woeful otter
#

yes, use a state trigger

orchid crater
#

Right. It’s almost time to reopen the issue about adding a lawn mower entity again…

civic slate
orchid crater
#

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.

civic slate
#

Yes, Gardena is part of Husqvarna

#

But shame about the PR

cedar carbon
#

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

gusty escarp
#

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

cedar carbon
#

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:

gusty escarp
#

Sounds to me that an addon managed by the Supervisor isn't for you

cedar carbon
#

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

cedar carbon
#

nevermind fixed it using the console application provided by roon deep harmony

rough shore
#

Are there any good example addons that use bluetooth devices? Having issue configuring alpine to work correctly with the bluez package needed.

sharp cloak
#

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

sharp cloak
#

I think I figured it out. I hadn't noticed the need to search/replace a string during setup.

pastel lotus
#

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

lavish apex
#

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.

rancid breach
#

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

lavish apex
#

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.

rancid breach
#

You are making a modified addon, it should be different.

#

copy your config section, or screenshot it. and install your version of the addon,

lavish apex
#

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.

rancid breach
#

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

quaint blade
#

so the recorder (history) have removed the get_state.. What can I use now?

blazing temple
timber badger
#

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 ?

blazing temple
#

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

storm meadow
#

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!

cloud sky
#

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?

frank lichen
#

@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

cloud sky
#

No, i'm talking about ENV

frank lichen
#

okay, but then what is the exact question?

cloud sky
#

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

frank lichen
#

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?

cloud sky
#

Yes, i need it as a ENV becaue i'm using the same docker file which is using enviroment variables

frank lichen
#

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

cloud sky
#

O.k, I'll take a look on that.

frank lichen
#

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

unique scroll
# cloud sky O.k, I'll take a look on that.

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

worldly rock
#

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?

hollow mulchBOT
#
Home Assistant
Owner

balloob#6041

Category Channels

8

Text Channels

54

Voice Channels

2

Members

93328

Roles

22

Role List

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

upbeat oyster
lavish apex
# worldly rock Hi all! I am wandering about how to make an addon register an entry via mDNS in ...

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.

astral briar
#

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

upbeat oyster
#

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)

astral briar
#

that work if it use the s6 ways to get the service running

#

you can use our example add-on

upbeat oyster
#

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}"
upbeat oyster
#

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.

ionic urchin
#

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?

cloud sky
#

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.

pseudo iron
#

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 🙂

worldly rock
worldly rock
# lavish apex You would use the addon option to get access to the host's DBUS (`host_dbus: tru...

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?

lavish apex
# worldly rock While waiting for pvizeli's hints, I was able to do what you suggested by using ...

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).

rare siren
#

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

worldly rock
crude shale
#

all an addon is, is a docker container

#

its fun

rare siren
crude shale
#

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

cinder jewel
#

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?)

crude shale
crude shale
#

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

cinder jewel
#

I get that there are no versions available when installing with pip

crude shale
#

what permissions does the repository updater personal access token need?

halcyon ether
#

hi , anyone have a addon that act as a dashboard for the devices

#

?

white canyon
#

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

crude shale
#

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.

scarlet copper
#

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

nimble quail
nimble quail
#

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?

wild hamlet
#

Ewe link, why do I have to manually sync addon every few days to be able to use a switch

gusty escarp
crude shale
lilac bronze
#

I'm trying to use Github codespaces with the HA devcontainer, but I get a 400: Bad Request. Did anybody get this working?

lilac bronze
crude shale
nimble quail
lilac bronze
crude shale
#

did you test the devcontiner locally?

lilac bronze
#

I tried to, but my docker with WSL2 is extremely slow for some reason. Just ls takes 2 minutes.

crude shale
lilac bronze
#

Wanted to test some new features, but my raspberry pi doesn't like building the new image.

crude shale
#

the devcontainer built and I am in it

lilac bronze
#

Hmm.. Then it is probably the proxy of the Github codespace right?

nimble quail
#

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' \

crude shale
nimble quail
#

mhmm, cou could try to add it in the homedir git config

#
~ ❯ cat ~/.gitconfig 
[user]
    name = Underknowledge
    email = blackhole@underknowledge.cc
crude shale
#

how do I do that within an action

nimble quail
#

I would cat EOF

cat <<EOF > ~/.gitconfig  
[user]
    name = Underknowledge
    email = blackhole@underknowledge.cc
EOF
crude shale
#

the thing is, I really don't know why this is happening to begin with

lilac bronze
crude shale
nimble quail
#

can you share where youre stuck?

lilac bronze
#

It's set to public. But it does take a second to load for me.

crude shale
nimble quail
#

What a thing. is it possible that you dont have a public mail for github?

lilac bronze
crude shale
lilac bronze
crude shale
#

but its a 400

lilac bronze
#

Yeah, that's what I get too.

nimble quail
#

I would say that it would be odd that you can expose ports in dev machines

#

wth, they let you do that 😄

lilac bronze
nimble quail
#

I should use something like this too. I only have 20Mbits here :/

celest canopy
#

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

nimble quail
#

I bet you sit already, step 2 now

lilac bronze
nimble quail
celest canopy
nimble quail
#

Hidden username? #6 hast a test script

crude shale
nimble quail
crude shale
#

I mean it seems like it has to do with the email based on the log output which could be triggering that maybe

nimble quail
crude shale
#

env:
EMAIL:

#

it seems to have reformatted my changelog however

nimble quail
#

🎉

#

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 )

nimble quail
#

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

nimble quail
#

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

dusty idol
#

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

dusty idol
pure solstice
#

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?

astral briar
#

No, CI have a fix limit of 6h

grave veldt
woeful otter
#

@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)

grave veldt
woeful otter
#

Don't worry m8 👍

pure solstice
#

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

glossy jetty
#

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

glossy jetty
#

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

pallid isle
#

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

glossy jetty
#

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

pallid isle
#

Do you have an apparmor profile for your addon by any chance?

glossy jetty
#

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

pallid isle
#

Ah

#

Yea that only grants permission to stuff in the folder

#

But can't list the contents of the folder with that

glossy jetty
#

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

pallid isle
#

Change it to this

/var/lib/nginx/{,**}
glossy jetty
#

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?

pallid isle
#

And that explains the difference, devcontainer does not use the apparmor profile cause it cant

glossy jetty
#

Ohh, I didn't realize that

pallid isle
#

You might need the / at the end

#

So to do two rules it's {folder}/ and {folder}/**

glossy jetty
#

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

pallid isle
#

You can also just use ix for now to allow it to execute with the same profile and then split out later

glossy jetty
#

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?

pallid isle
#

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

#

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

glossy jetty
#

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 🤦‍♂️

pallid isle
#

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

glossy jetty
#

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?

pallid isle
#

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

glossy jetty
#

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?

pallid isle
#

Yes that'll work

glossy jetty
#

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

pallid isle
#

Then just add all the things that come up

glossy jetty
#

Oh yeah, I just read that section of the example file too now that you mention it, that is really cool!

pallid isle
#

Oh right I did add that!

#

Lol

glossy jetty
#

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?

pallid isle
#

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

glossy jetty
#

Oh haha

pallid isle
#

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

#

Different topic, same problem

glossy jetty
#

Oh, thanks! Reading now

pure solstice
#

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
glossy jetty
#

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?

pure solstice
#

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

glossy jetty
#

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

pallid isle
# pure solstice https://github.com/PetHubLocal/addon is my addon if you are interested

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

pure solstice
#

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

pallid isle
#

I just have CI build and publish it

glossy jetty
#

My addon is running in my full HA instance now, thanks for the apparmor assist @pallid isle!

pallid isle
#

Borrowed from frenck

pure solstice
pallid isle
glossy jetty
#

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

pallid isle
#

Probably don't need all of that, Loki and promtail communicate in more complicated ways then usual. But definitely need at least network tcp

glossy jetty
#

I did not, I am betting that's it! Thanks for the tip!

pallid isle
#

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

glossy jetty
#

I at least want to support using hostname or IP address in the configuration so I probably do want that too

glossy jetty
#

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

pallid isle
glossy jetty
#

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

pallid isle
#

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

glossy jetty
#

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

pallid isle
#

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

glossy jetty
#

Can you ssh into an addon container?

pallid isle
#

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

glossy jetty
#

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

pure solstice
#

When you docker exec into your container you should be able to curl to the endpoint. Assuming curl is installed.

sonic wigeon
#

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?

sonic wigeon
#

🤔 I don't recognise the rootfs/etc/service.d path, is there any documentation for using it in addons?

woeful otter
#

@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 😄

sonic wigeon
sonic wigeon
#

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?

boreal dune
#

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.

full swan
#

Hi, is this the right channel to ask about a custom_integration using bluetooth?

boreal dune
#

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)

boreal dune
vague sundial
#

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.

worldly rock
#

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)

woeful otter
#

The errors param is the way to go

#

there is no other message type

worldly rock
#

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!

bronze falcon
#

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?

fierce tide
frigid geyser
#

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'

fierce tide
#

why i'm not getting those logs...

frigid geyser
#

Its in the supervisor logs.

#

you might not have selected the supervisor tab on the top

fierce tide
#

🤦‍♂️

#

thanks

frigid geyser
#

no problem 🙂

#

love to help

fierce tide
#

now its working fine. 🙂

buoyant needle
#

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

astral briar
#

should work

#

hassio_api is for supervisor access and home_assistant_api for core access

#

you should see your access on the su logs

buoyant needle
#

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'}
astral briar
#

feels like an issue with your access token

buoyant needle
#

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

prime junco
green lagoon
#

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?

arctic reef
#

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.

cloud basalt
#

That is one of the properties that can be set for an addon. The SSH addons behave that way, for instance

cloud basalt
#

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.

arctic reef
#

It must default to true

cloud basalt
#

Says not

#

Anyway, more info is there

arctic reef
#

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 🙂

arctic reef
#

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

safe monolithBOT
buoyant needle
#

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?

astral briar
#

yeah, that is how it should work

#

but only if the auth provider homeassistant is used

buoyant needle
#

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.

sacred crane
#

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

arctic reef
#

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?

arctic reef
arctic reef
analog tendon
#

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?

analog tendon
#

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
woeful otter
#

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?

analog tendon
#

how do I enter the container in hassio?

woeful otter
#

using docker? (as in, that is the answer :D)

analog tendon
#

ssh to the host and then docker into the container you mean?

woeful otter
#

yup

analog tendon
#

ok, let me enable host ssh first.. is there an option, or is that still a bit of work?

woeful otter
#

You don't need host SSH for that

#

The community SSH & Terminal add-on could be useful for debugging

#

it has the docker CLI

analog tendon
#

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

hasty carbon
#

how do i configure z2m in the new os8.3?
or where may i ask?
i always get "no need to configure"...

analog tendon
#

gotcha

woeful otter
analog tendon
#

found it.. dankjewel

woeful otter
#

np

hasty carbon
#

just found. 🙂

#

thx

analog tendon
analog tendon
#

Seems like it has something to do with a combination of Alpine and musl

hexed charm
#

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?

cloud basalt
safe monolithBOT
hexed charm
arctic reef
#

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