This is quick and dirty, if youre unfamiliar with anything I write here, I will be creating a blog post explaining how to install this, but if you want to test or deploy this you will need a few things:
The end result is an auto discovered entity in home assistant that looks like this:
- A box behind your dishy with Node-Red natively installed (not in docker)
- On that box have grpcurl installed and executable through node-red’s exec node.
- have connectivity to the same MQTT broker that your home assistant has.
- Next youll want to import this flow and change the MQTT broker config to yours:
[{"id":"a5086ebfe7251d3b","type":"exec","z":"5ba4ef406096e71c","command":"grpcurl -plaintext -d {\\\"getStatus\\\":{}} 192.168.100.1:9200 SpaceX.API.Device.Device/Handle","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"GRPCURL to SPACE","x":140,"y":280,"wires":[["6387d614b9b6d17c"],[],[]]},{"id":"4b78b8eaa95957d2","type":"inject","z":"5ba4ef406096e71c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":150,"y":220,"wires":[["a5086ebfe7251d3b"]]},{"id":"6387d614b9b6d17c","type":"json","z":"5ba4ef406096e71c","name":"convert to JSON","property":"payload","action":"","pretty":false,"x":370,"y":280,"wires":[["766a86bc0f8e3fc1"]]},{"id":"766a86bc0f8e3fc1","type":"function","z":"5ba4ef406096e71c","name":"Create Device Array","func":" msg.device = {};\n msg.device.identifiers = msg.payload.dishGetStatus.deviceInfo.id;\n msg.device.name = \"Dishy\" ;\n msg.device.model = msg.payload.dishGetStatus.deviceInfo.hardwareVersion ;\n msg.device.sw_version = msg.payload.dishGetStatus.deviceInfo.softwareVersion ;\n// device.configuration_url = msg.payload[i].url ;\n msg.device.manufacturer = \"SpaceX\" ;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":320,"wires":[["7729b8890686da31"]]},{"id":"7729b8890686da31","type":"change","z":"5ba4ef406096e71c","name":"Move the Payload","rules":[{"t":"move","p":"payload","pt":"msg","to":"oldpayload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":360,"wires":[["a331c133ba78d14e","02e1038ec2974622","dfb6b5bdd80cf9d8","2036dcf7f86aac51","d8b042b126c11acf","377d73ebd663a747","a4077ff3979daccc"]]},{"id":"a331c133ba78d14e","type":"change","z":"5ba4ef406096e71c","name":"Uptime Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Uptime\" ,\t \"unique_id\" : msg.device.name & \"-\" & \"uptime\",\t \"device_class\": \"duration\",\t \"unit_of_measurement\": \"s\",\t \"value_template\": \"{{value_json.uptimeS}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:timeline-clock\",\t \"state_topic\": \"dishy/uptime\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/uptime/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":340,"wires":[["2dc525b7323a066a","b8829e1eb4eabe44"]]},{"id":"02e1038ec2974622","type":"change","z":"5ba4ef406096e71c","name":"Downlink Throughput Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Download\" ,\t \"unique_id\" : msg.device.name & \"-downlinkmbps\",\t \"unit_of_measurement\": \"Mbps\",\t \"value_template\": \"{{value_json.downlinkThroughputmbps}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:chart-line\" ,\t \"state_topic\": \"dishy/downlinkmbps\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/downlinkmbps/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":280,"wires":[["61f9aae5da21fe13","b8829e1eb4eabe44"]]},{"id":"dfb6b5bdd80cf9d8","type":"change","z":"5ba4ef406096e71c","name":"Downlink Throughput Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Upload\" ,\t \"unique_id\" : msg.device.name & \"-uplinkmbps\",\t \"unit_of_measurement\": \"Mbps\",\t \"value_template\": \"{{value_json.uplinkThroughputmbps}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:chart-line\" ,\t \"state_topic\": \"dishy/uplinkmbps\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/uplinkmbps/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":200,"wires":[["547bbfd4414fc594","b8829e1eb4eabe44"]]},{"id":"2036dcf7f86aac51","type":"change","z":"5ba4ef406096e71c","name":"Latency Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Latency to POP\" ,\t \"unique_id\" : msg.device.name & \"-\" & \"latency\",\t \"unit_of_measurement\": \"ms\",\t \"value_template\": \"{{value_json.popPingLatencyMs}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:graphql\",\t \"state_topic\": \"dishy/latency\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/latency/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":400,"wires":[["e71cef43fcf8860c","b8829e1eb4eabe44"]]},{"id":"d8b042b126c11acf","type":"change","z":"5ba4ef406096e71c","name":"Obstruction Time Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Avg Obstruction Time\" ,\t \"unique_id\" : msg.device.name & \"-\" & \"avgobstruction\",\t \"device_class\": \"duration\",\t \"unit_of_measurement\": \"s\",\t \"value_template\": \"{{value_json.avgProlongedObstructionDurationS}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:timeline-clock\",\t \"state_topic\": \"dishy/avgobstructiontime\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/avgobstime/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":460,"wires":[["8c763c35c86c31ac","b8829e1eb4eabe44"]]},{"id":"377d73ebd663a747","type":"change","z":"5ba4ef406096e71c","name":"Obstruction Interval Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Avg Obstruction Interval\" ,\t \"unique_id\" : msg.device.name & \"-\" & \"avgobstructioninterval\",\t \"device_class\": \"duration\",\t \"unit_of_measurement\": \"s\",\t \"value_template\": \"{{value_json.avgProlongedObstructionIntervalS}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:timeline-clock\",\t \"state_topic\": \"dishy/avgobstructioninterval\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/avgobsinterval/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":520,"wires":[["0e1a718bd4bab144","b8829e1eb4eabe44"]]},{"id":"a4077ff3979daccc","type":"change","z":"5ba4ef406096e71c","name":"Satellites Discovery","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": msg.device.name & \" Sats\" ,\t \"unique_id\" : msg.device.name & \"-\" & \"sats\",\t \"unit_of_measurement\": \"Satellites\",\t \"value_template\": \"{{value_json.gpsSats}}\",\t \"device\": msg.device ,\t \"icon\": \"mdi:satellite-variant\",\t \"state_topic\": \"dishy/sats\"\t}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"homeassistant/sensor/dishy/sats/config","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":580,"wires":[["700ba7c55877f60b","b8829e1eb4eabe44"]]},{"id":"2dc525b7323a066a","type":"change","z":"5ba4ef406096e71c","name":"Uptime State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"oldpayload.dishGetStatus.deviceState","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/uptime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":340,"wires":[["c211d3b312a7b774"]]},{"id":"b8829e1eb4eabe44","type":"mqtt out","z":"5ba4ef406096e71c","name":"Discovery Configuration","topic":"","qos":"","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e2017447d7647e70","x":1530,"y":300,"wires":[]},{"id":"61f9aae5da21fe13","type":"change","z":"5ba4ef406096e71c","name":"Downlink Mbps State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"oldpayload.dishGetStatus.downlinkThroughputBps","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/downlinkmbps","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":280,"wires":[["68b745915d488b48"]]},{"id":"547bbfd4414fc594","type":"change","z":"5ba4ef406096e71c","name":"Uplink Mbps State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"oldpayload.dishGetStatus.uplinkThroughputBps","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/uplinkmbps","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":200,"wires":[["2ea85b8117c89502"]]},{"id":"e71cef43fcf8860c","type":"change","z":"5ba4ef406096e71c","name":"Latency State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload.popPingLatencyMs","pt":"msg","to":"oldpayload.dishGetStatus.popPingLatencyMs","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/latency","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":400,"wires":[["d8fe2ba431bdb511"]]},{"id":"8c763c35c86c31ac","type":"change","z":"5ba4ef406096e71c","name":"Obstruction Time State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload.avgProlongedObstructionDurationS","pt":"msg","to":"oldpayload.dishGetStatus.obstructionStats.avgProlongedObstructionDurationS","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/avgobstructiontime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":460,"wires":[["fe4ed274ad3c7189"]]},{"id":"0e1a718bd4bab144","type":"change","z":"5ba4ef406096e71c","name":"Obstruction Time State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload.avgProlongedObstructionIntervalS","pt":"msg","to":"oldpayload.dishGetStatus.obstructionStats.avgProlongedObstructionIntervalS","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/avgobstructioninterval","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":520,"wires":[["7f9c7d6a95897d6e"]]},{"id":"700ba7c55877f60b","type":"change","z":"5ba4ef406096e71c","name":"Satellites State","rules":[{"t":"move","p":"payload","pt":"msg","to":"discovery_payload","tot":"msg"},{"t":"set","p":"payload.gpsSats","pt":"msg","to":"oldpayload.dishGetStatus.gpsStats.gpsSats","tot":"msg","dc":true},{"t":"set","p":"topic","pt":"msg","to":"dishy/sats","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":580,"wires":[["c211d3b312a7b774","4e3d8b28bb7e3b62"]]},{"id":"c211d3b312a7b774","type":"mqtt out","z":"5ba4ef406096e71c","name":"Data Topics","topic":"","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e2017447d7647e70","x":1510,"y":400,"wires":[]},{"id":"68b745915d488b48","type":"function","z":"5ba4ef406096e71c","name":"Bits to Mbits","func":"msg.payloadbps = msg.payload\ndelete msg.payload\nmsg.payload = {};\nmsg.payload.downlinkmbps = msg.payloadbps / 1000000\nmsg.payload.downlinkThroughputmbps = parseFloat(msg.payload.downlinkmbps.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":280,"wires":[["c211d3b312a7b774","943185c20352c9f9"]]},{"id":"2ea85b8117c89502","type":"function","z":"5ba4ef406096e71c","name":"Bits to Mbits","func":"msg.payloadbps = msg.payload\ndelete msg.payload\nmsg.payload = {};\nmsg.payload.uplinkmbps = msg.payloadbps / 1000000\nmsg.payload.uplinkThroughputmbps = parseFloat(msg.payload.uplinkmbps.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":200,"wires":[["943185c20352c9f9","c211d3b312a7b774"]]},{"id":"d8fe2ba431bdb511","type":"function","z":"5ba4ef406096e71c","name":"Latency Normalizer","func":"msg.payload.popPingLatencyMs = parseFloat(msg.payload.popPingLatencyMs.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":400,"wires":[["c211d3b312a7b774"]]},{"id":"fe4ed274ad3c7189","type":"function","z":"5ba4ef406096e71c","name":"Latency Normalizer","func":"msg.payload.avgProlongedObstructionDurationS = parseFloat(msg.payload.avgProlongedObstructionDurationS.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":460,"wires":[["c211d3b312a7b774"]]},{"id":"7f9c7d6a95897d6e","type":"function","z":"5ba4ef406096e71c","name":"Latency Normalizer","func":"msg.payload.avgProlongedObstructionIntervalS = parseFloat(msg.payload.avgProlongedObstructionIntervalS.toFixed(2));\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":520,"wires":[["c211d3b312a7b774"]]},{"id":"4e3d8b28bb7e3b62","type":"debug","z":"5ba4ef406096e71c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1470,"y":480,"wires":[]},{"id":"943185c20352c9f9","type":"debug","z":"5ba4ef406096e71c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1470,"y":120,"wires":[]},{"id":"e2017447d7647e70","type":"mqtt-broker","name":"HomeAssistant","broker":"10.10.1.2","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]