Fully Kiosk integration does not work

Hi all,
i am trying to integrate the fully kiosk integration exactly like in : Fully Kiosk Browser

But finally I did not get it running in HA.

the sensors does not deliver any value.

in General the API call seams to work, cause if I post the following url into my browser I get a result:
http://MYDEVICEIP:2323/?cmd=deviceInfo&type=json&password=MYFULLYKIOSKPW

{"deviceName":"Galaxy Tab A7","batteryLevel":97,"........  
"currentPage":"http://homeassXXX/lovelace/default_view","lastAppStart":"27.12.20 09:49:18"}

In my HA logs I can see following:

2020-12-27 10:04:02 DEBUG (MainThread) [httpx._client] HTTP Request: GET http://XXXX:2323/?cmd=deviceInfo&type=json&password=XXXXX "HTTP/1.1 200 OK "

020-12-27 10:04:34 DEBUG (MainThread) [httpx._client] HTTP Request: GET http://XXXX:2323/?cmd=deviceInfo&type=json&password=XXXXX "HTTP/1.1 200 OK "
2020-12-27 10:04:34 DEBUG (MainThread) [homeassistant.components.rest.sensor] Data fetched from resource: {"status":"Error","statustext":"Please login"}

So it seams that in general it cannot login the rest api

My semsor.yaml looks following:

  - platform: rest
    name: openweather_report2
    json_attributes:
        - current
        - daily
    value_template: "{{ value_json['current']['dt'] | timestamp_custom('%Y-%m-%d %H:%M', true) }}"
    resource: !secret openweathermap_rest
    scan_interval: 3600
    
    
  - platform: rest    
    name: tablet_ha
    json_attributes:
      - batteryLevel
      - kioskMode
      - screenBrightness
      - motionDetectorState
      - maintenanceMode
      - appFreeMemory
      - appUsedMemory
      - totalFreeMemory
      - totalUsedMemory
      - hostname4
      - ip4
      - mac
      - locationLatitude
      - locationLongitude
      - locationAltitude
      - startUrl
      - currentPage
    resource: !secret tablet_ha_fullykiosk_rest
    value_template: '{{ value_json.isScreenOn }}'

    
  - platform: template
    sensors:
    
      tablet_ha_battery_level:
        friendly_name: "tablet_ha_battery_level"
        unit_of_measurement: '%'
        value_template: "{{ states.sensor.tablet_ha.attributes.batteryLevel }}"
        
      dayoftheweek:
        value_template: >
          {{ ['Mo','Di','Mi','Do','Fr','Sa','So'][now().weekday()] }}

with the following secrets.yaml:

tablet_ha_fullykiosk_rest: http://MYDEVICEIP:2323/?cmd=deviceInfo&type=json&password= MYFULLYKIOSKPW

tablet_ha_screen_on: "/usr/bin/curl -X POST 'http://MYDEVICEIP:2323/?cmd=screenOn&type=json&password= MYFULLYKIOSKPW'"
tablet_ha_screen_off: "/usr/bin/curl -X POST 'http://MYDEVICEIP:2323/?cmd=screenOff&type=json&password= MYFULLYKIOSKPW'"
tablet_ha_screen_state: '/usr/bin/curl --silent -X GET "http://MYDEVICEIP:2323/?password= MYFULLYKIOSKPW" |grep "Screen status" |grep "on\|off" |sed "s/<[^>]*>//g" |sed "s/Screen status//g" |sed "s/Turn on//g" |sed "s/Turn off//g"'

Does anybody has an idea which config I did wrong?
Many thanks in advance

Ok found out what I did wrong. I uses a β€˜#’ in the PW and this does not work. After removing this character in my FullyKioskPW it works

1 Like

Wow thanks for this! I spent the whole day yesterday trying to troubleshoot it.

You are a saint! I spent well over 4 hours researching why my REST response was empty. My Kiosk passwords had an underscore β€œ_”. As you mentioned above, special characters don’t play nice with the API call.

1 Like

Some characters of an URL have a special meaning and are regarded as reserved characters.

You can still use them in your password but you need to URL encode them.
e.g. # needs to be written as %23 or a space needs to be written as %20.

See more on this on the Percent-encoding Wikipedia page.

My sensor in config looks like this

  - platform: template
    sensors:
      fully_paaath:
        friendly_name: "sFully dashboard"
        entity_id: sensor.sfully_dashboard
        value_template: "{{ states.sensor.sfully_dashboard.attributes.currentpage }}"
  - platform: rest
    name: sfully_dashboard1
    json_attributes:
     - currentPage
    resource: http://192.168.0.13:2323/?cmd=deviceInfo&type=json&password=obfuscated
    timeout: 360

but is always unavailable? any ideas why?