[App][Pro] Micro Web Server

Hi,

I recently updated to Homey V5 and noticed that soundboard in combination with Sonos Play:1 isn’t working anymore. I use it the play an mp3 (doorbell, alarm, etc.). I was directed to Micro Web Server and it is fulfilling my need, only one thing isn’t working as before -
there is quite a delay before the mp3 is played over my Sonos speaker -
up to 8 or 9 seconds after the ‘Then’ is started and a green :white_check_mark: is placed before the card with the ‘Play an URL’ action. The mp3 file is only 30Kb.
Anyone an idea where to look for improvement or root cause of the delay?

That’s quite a lot. I use it myself in combination with the Chromecast app for a doorbell thing. But there is no delay at all. Maybe it is related to the recent Sonos app update?

PS: I do not have any Sonos myself.

Just tested this with my SonosPlaybar, delay is not more then 2 seconds (doorbel sound)

Is there a way to periodically check automated whether the FTP server in online and if not start it? Could not find an action card for that…

Hi @Jolink,
well, the FTP server is not meant to be running automatically. It is not started automatically if the app or Homey restarts. But I guess I could add such an option if this is something needed. What’s your usecase?

1 Like

I saw that each time after a Homey update the FTP server stopped running. My conclusion was that in order for Sonos to reach the mp3 file on my Homey the ftp server needs to run. Thinking this through once more, I doubt that / don’t think it needs to run, only if you want to transfer a file to Homey. Once locally stored on Homey, the file can be reached even if the ftp server is down.
Is that correct? If so, no need anymore to run the FTP server constantly I guess…

Yeah, the files should be reachable through the http server of course. FTP is currently meant for administration of the content only.

However, if more people would be interrested in an option to have ftp permanently enabled as well, I will of course consider giving that as option through the app settings page.

Ok, thnx for the confirmation! No need anymore for my earlier request…

@Shakesbeard May I suggest to add a login when FTP service can be set to “always run”? Or is it overkill? It is and stays local, but… IDK how much extra work is involved for that.
Just an idea, my Homey almost never reboots so for me it is fine just how it is.
And a great app btw🍻

2 Likes

@Peter_Kawa @Jolink and whomever might need that feature.

2 Likes

Many thanks, Thomas!

1 Like

Used this for playing Christmas songs outdoors last year.
But don’t get it to work now.

Has there been any changes?

Using the cast a website with http://192.168.x0.xxx:5080/1.mp3

Any ideas why it’s not working?

My Google speaker mini is showing red dots

No changes on this app. Cannot tell about the chromecast app though.

1 Like

Still works fine, maybe your Homey needs a PTP.

1 Like

Got it working.
For some reason, it worked after resetting the Google mini.

Thanks for the answers :ok_hand:

1 Like

Hi, Looks like I can not customise the response of the trigger request. Is it possible to support that?

e.g. In “When” section I would like to create a card called “A WebTrigger was received temperature”, then in “Then” section there is a card called something like “A WebTrigger responds [tag:temperature]”.

In browser, GET url http://homey-abc:5080/webTrigger?name=temperature will receive response text “21.3” which comes from a temperature sensor.

Is this feasible?

Thanks.

It is not possible to get it to respond a value. This was never the intention of this feature. It mere is a lightweight webhook receiver. I am using it with Flic Hub for example.

But I am not planning to extend that feature. If you need more feature rich webhooks there are a few apps out there which specilize on that. Might be worth looking around the app store.

This prolly is not the answer you wanted, but I do not see the benefit in adding features which can be covered by already existing apps.

1 Like

Because I have quite old Axis camera’s that don’t have app (incl. ONVIF) sensor capabilities, I’m trying to define triggers as a separate event in the camera that will send a HTTP or TCP notification to Homey based on motion detection or PIR activation. I’ve installed the Micro Webserver app that is able to capture these http notifications. The cameras and Homey are in the same LAN.

So far I tried the following in the camera configuration:

TCP event server

HTTP Event server:

Testing the connection results in “connection OK” when using TCP, but “Connection failed” in the HTTP event server. The app explanation does not show a requirement to use a username or password.

Event trigger (partly):

The logs of the camera used for the http notification show:

<CRITICAL> […] shttpclient[26334]: Failed opening connection to server.
<INFO> […]httpnotifywrapper: shttpclient failed with status '255', argument ' -q 0 http://homey-xxxxxxxxxxxxxxxxxxx:5080/webTrigger?name=httptest&data1=2022'

There is nothing in the log about the TCP notification.

It’s the first time I’m working with webhooks of this kind. On the Homey side I’ve created 2 flows that are triggered by a received webhook containing the name httptest and tcptest, but they’re not activated by these messages. I’m not even sure that the notifications are captured by Homey.

Is there any option to see what messages are received by Homey on port 5080? Are there any other (obvious) mistakes in my attempts?

Peter

First I think you should replace homey-xxxx with Homey’s IP 192.168.10.100

2nd, did you check the flow Logics card "received webhook / received http event?

You can send a webhook to Homey like this (web server app isn’t needed):
http://192.168.10.100/api/manager/logic/webhook/httptest?tag=2022
It should be sent as GET request, otherwise the http requests app can be of use

Thx Peter!

Turns out that using the IP in stead of the homey-[id] did the trick.

I read in a HA forum that Axis uses GET (not tried it myself). But unfortunately Axis has an annoying method of parsing the request. Axis places a “?” before the custom parameters, in this case
http://192.168.10.100/api/manager/logic/webhook/?httptest?tag=2022. Off course I could also use the tag, but this requires an “unparser” in Homey for using the different variables.
The way the Micro Web Server handles these webTriggers and the easiest for me and it also allows 5 tags. Moreover, the FTP solution of this app may become useful as well.

@Shakesbeard You might want to consider to add this to the app notes, including that the local Homey IP can (also) be used in the webTrigger.

Peter

1 Like