I use NodeRed with this flow:
[{"id":"bdf8cd6f.ad5c3","type":"tab","label":"PHP State Endpoint","disabled":false,"info":""},{"id":"b05b14fc.2bb988","type":"http in","z":"bdf8cd6f.ad5c3","name":"","url":"/hastate","method":"get","upload":false,"swaggerDoc":"","x":150,"y":60,"wires":[["62eb1352.a9756c"]]},{"id":"4414b44.8b3f44c","type":"ha-get-entities","z":"bdf8cd6f.ad5c3","name":"","server":"49949cfc.3312d4","version":0,"rules":[{"property":"entity_id","logic":"is","value":"[a-z].*\\..*","valueType":"re"}],"output_type":"array","output_empty_results":true,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":150,"y":120,"wires":[["67bd9d28.06ebb4"]]},{"id":"67bd9d28.06ebb4","type":"http response","z":"bdf8cd6f.ad5c3","name":"","statusCode":"","headers":{"content-type":"application/json"},"x":470,"y":200,"wires":[]},{"id":"d1e53794.50d368","type":"debug","z":"bdf8cd6f.ad5c3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":640,"y":80,"wires":[]},{"id":"62eb1352.a9756c","type":"switch","z":"bdf8cd6f.ad5c3","name":"","property":"payload.req","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":40,"wires":[["5827eb49.e4ed94"],["4414b44.8b3f44c"]]},{"id":"5827eb49.e4ed94","type":"ha-get-entities","z":"bdf8cd6f.ad5c3","name":"","server":"49949cfc.3312d4","version":0,"rules":[{"property":"entity_id","logic":"starts_with","value":"payload.req","valueType":"msg"}],"output_type":"array","output_empty_results":true,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":410,"y":120,"wires":[["67bd9d28.06ebb4"]]},{"id":"49949cfc.3312d4","type":"server","name":"Gaia","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":true,"heartbeatInterval":"60"}]
I am then able to make simple REST calls like this:
http://homeassistanturl:1880/endpoint/hastate
To receive ALL entities.
http://homeassistanturl:1880/endpoint/hastate?req=light
To get ALL light entities.
http://homeassistanturl:1880/endpoint/hastate?req=sensor.andy_mobile_battery
To receive just a single entity.