alarmserver icon indicating copy to clipboard operation
alarmserver copied to clipboard

[Feature request] Home Assistant addon

Open Vinndimon opened this issue 2 years ago • 10 comments

It would be nice to have this MQTT server as a Hassio addon that works with Mosquitto. Many Home Assistant users prefer Home Assistant OS that runs on Raspberry Pi or something similar. Hass OS does not allow third-party containers. At least, it is not recommended.

Vinndimon avatar Oct 13 '21 12:10 Vinndimon

It seems like it's a good idea!

I don't use Hassio/Hass OS/HA's supervisor thing myself, but I would definitely welcome it as a contribution and would be happy to help with it however I can.

Is that something you'd be interested in implementing?

toxuin avatar Nov 04 '21 14:11 toxuin

HI, @toxuin

I really love your Alarm Server. The problem is that HA doesn't support the use of docker outside HA.

So It would be very nice to have this Alarm-server as HA addon. some information about how HA works withs addons: https://developers.home-assistant.io/docs/add-ons/tutorial I tried to fix it myself, but my coding and docker skills aren't that good.

Maybe you can point me in the right direction. I would like to try.!

miit86 avatar Nov 13 '21 10:11 miit86

@toxuin unfortunately I am not a programmer myself. Thus it is a feature request, but I won't be able to create a server with my own hands.

Vinndimon avatar Nov 13 '21 10:11 Vinndimon

see my config.json First try to install it without any options set.

{
    "name": "Alarm_Server",
    "version": "0.1",
    "slug": "Alarm_Server",
    "description": "Alarm Server for XMEye and Hikvision",
    "arch": [
        "armhf",
        "armv7",
        "aarch64",
        "amd64",
        "i386"
    ],
    "url": "https://github.com/toxuin/alarmserver",
    "image": "toxuin/alarmserver",
    "startup": "before",
    "boot": "auto",
    "options": {},
    "schema": {},
    "ports": {
        "15002/tcp": 15002
    }
}

Receive this warning:

Can't install toxuin/alarmserver:0.1: 404 Client Error for http+docker://localhost/v1.41/images/create?tag=0.1&fromImage=toxuin%2Falarmserver: Not Found ("manifest for toxuin/alarmserver:0.1 not found: manifest unknown: manifest unknown")

miit86 avatar Nov 13 '21 10:11 miit86

@miit86 I think it waits for manifest.json which is not present. Here is the doc: https://developers.home-assistant.io/docs/creating_integration_manifest/

Vinndimon avatar Nov 14 '21 13:11 Vinndimon

Hi, I got the alarm_server installed as addon in HA. but i'm unable to load the config.

miit86 avatar Dec 28 '21 20:12 miit86

Hi @toxuin,

you use docker run -d -v $PWD/config.yml:/config.yml -v $PWD/ftp:/ftp -p 21:21 -p 15002:15002 toxuin/alarmserver thats not possible in home assitant.

  • do you know how I can copy the config.yml with the use of the docker file?

I tried

FROM golang:1.16-alpine AS build_base
RUN apk add ca-certificates

WORKDIR /tmp/app
COPY config.yml ./

COPY . .
RUN go get -d ./... && CGO_ENABLED=0 go build -ldflags="-w -s" -o ./out/alarmserver

FROM scratch
COPY --from=build_base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=build_base /tmp/app/out/alarmserver /alarmserver


EXPOSE 15002

ENTRYPOINT ["/alarmserver"]

but the only thing I get in log is this:

panic: Both MQTT and Webhook buses are disabled. Nothing to do!
goroutine 1 [running]:
github.com/toxuin/alarmserver/config.(*Config).Load(0xd)
	/tmp/app/config/config.go:136 +0x79f
main.main()
	/tmp/app/main.go:24 +0x35

miit86 avatar Mar 12 '22 19:03 miit86

Hey I don't use this from within Home Assistant, but I do use it in conjunction with it. They communicate over MQTT but run on separate machines.

Error of Both MQTT and Webhook buses are disabled. Nothing to do! means either your config is not accessible from within the container or you actually have both buses disabled in your config file.

Can you please confirm that you got at least one bus enabled in your config?

toxuin avatar Mar 12 '22 20:03 toxuin

Hi,

the file config.yml isn't copied. or copied to the wrong place.

miit86 avatar Mar 14 '22 17:03 miit86

example hass addon https://github.com/alexxx113/alarmserver

install supervisor config run

works alarmserver-linux-raspberry, config, mqtt, hisilicon, ftp

THE addon IS PROVIDED "AS IS" no Pull requests no help

alexxx113 avatar Sep 02 '22 22:09 alexxx113