Fully Kiosk Browser

pi@pi2:~ $ curl --silent -X GET "http://192.168.1.50:2323/?password=xxx" |grep "Screen status" |grep "on\|off" |sed "s/<[^>]*>//g" |sed "s/Screen status//g" |sed "s/Turn on//g" |sed "s/Turn off//g"'
>

On the command line, to a “man curl”. This will show the manual for the command “curl”.
The quick answer is:

–silent
Silent or quiet mode. Don’t show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it.

Grep is used to search for a string, within data. In this case, it’s searching “Screen status” or “on|off”.

What are you trying to do with the rest_command?

yes, this way it works. Thanks!

This worked out great! Thanks!

Errors like these simply mean the command failed for some reason…
To troubleshoot, just put the URL string on the command line, with curl. So:

curl http://192.168.1.50:2323/?cmd=screenOn&type=json&password=xxx

and see what it returns…
To emulate the command exactly, you should use:

curl -X POST http://192.168.1.50:2323/?cmd=screenOn&type=json&password=xxx

The browser does a great job of hiding the output necessary to troubleshoot the issue.

I just thought I could not use the command becasue of HASSIO, but on the contrary it works

Glad we can help been messing with Kisok for a few weeks now

Remove the “–silent” and post the output here please.

pi@pi2:~ $ curl -X GET "http://192.168.1.50:2323/?password=xxx" |grep "Screen status" |grep "on\|off" |sed "s/<[^>]*>//g" |sed "s/Screen status//g" |sed "s/Turn on//g" |sed "s/Turn off//g"'
>

Maybe I’m confused, which command isn’t working here?
Above you showed an error message for “mi5splus_screen_on”, then we started talking about the “Screen status” command, so which one isn’t working for you (they are 2 very different commands)?

This not working

rest_command:
mi5splus_screen_on:
url: ‘http://192.168.1.50:2323/?cmd=screenOn&type=json&password=xxx
method: post
mi5splus_screen_off:
url: ‘http://192.168.1.50:2323/?cmd=screenOff&type=json&password=xxx
method: post

YOur set IS working

  • platform: command_line
    switches:
    foo_screen:
    command_on: !secret foo_screen_on
    command_off: !secret foo_screen_off
    command_state: !secret foo_screen_state
    value_template: ‘{{ value == “on” }}’
    friendly_name: Foo Screen

for screen status (I am not sure what is needed for) I receive the above

@xstrex pretty cool project, one of my favourites!

Yes! Awaiting my 100 dollar 10 inch screen from gearbest :slight_smile:

Which would be a command for setting the brightness level?

The command I think would be

/usr/bin/curl -k "http://KioskIP:2323/?cmd=setStringSetting&key=screenBrightness&value=200&password=KioskPassword"

Where value is 0 - 255

It does change the value in the Kiosk admin page, but not on the actual device

let me see what it does on mine, a little later not had chance to test

i have just tested it quickly and it dims the screen to the value set.

Tested via a URL in a browser

strange, not on mine.

Anyway it does work the EnableMotionDetection, which is pretty cool. ù
But how to make it go off after a while?

you could just set a screen turn off timer ? thats the simplest way, thats how I do it, turns off 2 mins after the screen is woken up…