I reverse engineered the FX4100’s status page json-rpc and made a sensor configuration for your configuration.yaml and I provde an example entity card that uses template-entity-row for the connection tech field.
Here is the configuration.yaml addition:
rest:
- scan_interval: 5
method: POST
verify_ssl: false
payload: '[{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_status_bar_data",{}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_lp_device_info",{}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_lp_sim_info",{}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_lp_settings_info",{}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.datausage","get_interface_data_usage_info",{"sim_slot":1}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_lp_wifi_info",{}]},{"jsonrpc":"2.0","id":1,"method":"call","params":["00000000000000000000000000000000","sysinterface.ui","get_basic_info",{}]}]'
resource: https://192.168.1.1/ubus
sensor:
- name: "tmob_get_status_bar_data"
json_attributes_path: "$[0].result[1]"
value_template: "OK"
json_attributes:
- "status_bar_antenna_status"
- "status_bar_roaming"
- "status_bar_femto"
- "status_bar_traffic_status"
- "status_bar_service_status"
- "status_bar_airplane_mode"
- "status_bar_connection_status"
- "status_bar_ethernet_supported"
- "status_bar_ethernet_enabled"
- name: "tmob_status_bar_data_sim_info"
json_attributes_path: "$[0].result[1].status_bar_sim.info[0]"
value_template: "OK"
json_attributes:
- "carrier_id"
- "slot"
- "status"
- "carrier_lock_status"
- "operator_name"
- "operator_id"
- "bars"
- "technology"
- "icon_type"
- name: "tmob_lp_device_info"
json_attributes_path: "$[1].result[1]"
value_template: "OK"
json_attributes:
- "device_name"
- "imei"
- "imeisv"
- "mac_address"
- "sku"
- "fw_version"
- "pri_version"
- "cute_version"
- "os_version"
- "antenna_status"
- "lan_ip_address"
- "mesh_enabled"
- "nodes"
- "total_devices"
- "wifi_devices"
- "ethernet_devices"
- "usb_devices"
- "blocked_devices"
- "active_wan"
- "eth_wan_state"
- "wwan_wan_state"
- "wan_conn_duration"
- "active_ethernet_port"
- "service_status"
- "connection_status"
- "wan_ip_address"
- "sim_status"
- "tech"
- "roam"
- "operator_name"
- "band"
- "bandwidth"
- name: "tmob_lp_sim_info"
json_attributes_path: "$[2].result[1].sim_info[0]"
value_template: "OK"
json_attributes:
- "slot"
- "imsi"
- "iccid"
- "mdn"
- "tech"
- "roam"
- "sinr"
- "rsrp"
- "rsrq"
- "snr"
- "rssi"
- "pci"
- "operator_name"
- "apn"
- "ecgi"
- "sim_status"
- "service_status"
- "connection_status"
- name: "tmob_lp_settings_info"
json_attributes_path: "$[3].result[1]"
value_template: "OK"
json_attributes:
- "ippt_enabled"
- "port_foward_enabled"
- "port_filter_enabled"
- "gps_enabled"
- "inseego_connect_enabled"
- name: "tmob_interface_data_usage_info"
json_attributes_path: "$[4].result[1]"
value_template: "OK"
json_attributes:
- "du_available_state"
- "plan_type"
- "cycle_start_date"
- "cycle_end_date"
- "usage_timestamp"
- "plan_limit"
- "line_usage"
- "shared_usage"
- "tx_bytes"
- "rx_bytes"
- "plan_limit_bytes"
- "tx"
- "rx"
- "unit"
- "prepay_indicator"
- "mdn"
- "is_data_available"
- name: "tmob_lp_wifi_info"
json_attributes_path: "$[5].result[1]"
value_template: "OK"
json_attributes:
- "wifi_primary_enabled"
- "wifi_primary_ssid"
- "wifi_primary_password"
- "wifi_guest_enabled"
- "wifi_guest_ssid"
- "wifi_guest_password"
- name: "tmob_basic_info"
json_attributes_path: "$[6].result[1]"
value_template: "OK"
json_attributes:
- "product"
- "user_guide_url"
- "language"
- "date_format"
- "hour_format"
- "numeric_format"
- "model"
And here is an example entity card that hits the important attributes:
type: entities
entities:
- type: attribute
entity: sensor.tmob_basic_info
name: model
attribute: model
- type: attribute
entity: sensor.tmob_status_bar_data_sim_info
name: bars
attribute: bars
suffix: bars
- type: attribute
entity: sensor.tmob_status_bar_data_sim_info
name: operator_name
attribute: operator_name
- type: attribute
entity: sensor.tmob_status_bar_data_sim_info
name: operator_id
attribute: operator_id
- type: attribute
entity: sensor.tmob_interface_data_usage_info
name: tx_bytes
attribute: tx_bytes
suffix: B
- type: attribute
entity: sensor.tmob_interface_data_usage_info
name: rx_bytes
attribute: rx_bytes
suffix: B
- type: attribute
entity: sensor.tmob_interface_data_usage_info
name: usage_timestamp
attribute: usage_timestamp
- type: attribute
entity: sensor.tmob_interface_data_usage_info
name: mdn
attribute: mdn
- type: attribute
entity: sensor.tmob_lp_device_info
name: fw_version
attribute: fw_version
- type: attribute
entity: sensor.tmob_lp_device_info
name: pri_version
attribute: pri_version
- type: attribute
entity: sensor.tmob_lp_device_info
name: cute_version
attribute: cute_version
- type: attribute
entity: sensor.tmob_lp_device_info
name: os_version
attribute: os_version
- type: attribute
entity: sensor.tmob_lp_device_info
name: total_devices
attribute: total_devices
- type: attribute
entity: sensor.tmob_lp_device_info
name: mac_address
attribute: mac_address
- type: attribute
entity: sensor.tmob_lp_device_info
name: lan_ip_address
attribute: lan_ip_address
- type: attribute
entity: sensor.tmob_lp_device_info
name: wan_ip_address
attribute: wan_ip_address
- type: attribute
entity: sensor.tmob_lp_device_info
name: wwan_wan_state
attribute: wwan_wan_state
- type: attribute
entity: sensor.tmob_lp_device_info
name: wan_conn_duration
attribute: wan_conn_duration
suffix: s
- type: attribute
entity: sensor.tmob_lp_device_info
name: sim_status
attribute: sim_status
- type: attribute
entity: sensor.tmob_lp_device_info
name: service_status
attribute: service_status
- type: attribute
entity: sensor.tmob_lp_device_info
name: connection_status
attribute: connection_status
- type: attribute
entity: sensor.tmob_lp_device_info
name: tech
attribute: tech
- type: custom:template-entity-row
entity: sensor.tmob_lp_device_info
name: tech_name
state: >-
{% set st = state_attr("sensor.tmob_lp_device_info","tech") %} {% set sm =
{0:"None",1:"Wi-Fi",2:"GPRS",3:"1XRTT",4:"EVDO
REV0",5:"UMTS",6:"HSDPA",7:"EDGE",8:"EVDO
REV0",9:"HSUPA",10:"HSPA+",11:"4G LTE",12:"4G LTE+",17:"5G"} %} {{
sm.get(st, "Unknown") }}
- type: attribute
entity: sensor.tmob_lp_device_info
name: band
attribute: band
- type: attribute
entity: sensor.tmob_lp_device_info
name: bandwidth
attribute: bandwidth
- type: attribute
entity: sensor.tmob_lp_device_info
name: antenna_status
attribute: antenna_status
- type: attribute
entity: sensor.tmob_lp_device_info
name: roam
attribute: roam
- type: attribute
entity: sensor.tmob_lp_settings_info
name: port_foward_enabled
attribute: port_foward_enabled
- type: attribute
entity: sensor.tmob_lp_sim_info
name: imsi
attribute: imsi
- type: attribute
entity: sensor.tmob_lp_sim_info
name: iccid
attribute: iccid
- type: attribute
entity: sensor.tmob_lp_sim_info
name: sinr
attribute: sinr
- type: attribute
entity: sensor.tmob_lp_sim_info
name: rsrp
attribute: rsrp
suffix: dB
- type: attribute
entity: sensor.tmob_lp_sim_info
name: rsrq
attribute: rsrq
suffix: dB
- type: attribute
entity: sensor.tmob_lp_sim_info
name: snr
attribute: snr
suffix: dB
- type: attribute
entity: sensor.tmob_lp_sim_info
name: rssi
attribute: rssi
- type: attribute
entity: sensor.tmob_lp_sim_info
name: pci
attribute: pci
- type: attribute
entity: sensor.tmob_lp_sim_info
name: apn
attribute: apn
- type: attribute
entity: sensor.tmob_lp_sim_info
name: ecgi
attribute: ecgi
- type: attribute
entity: sensor.tmob_lp_wifi_info
name: wifi_primary_ssid
attribute: wifi_primary_ssid
I hope this helps anybody who would like to see the same data that comes from the status page and updates every five seconds to that page, but going to home assistant. This is actually more performant since their page requests each of these rpc endpoints with separate rest calls. I just do one rest call with all rpc-json endpoints in the same post data and have the sensor response pull out the dictionaries and make attributes where each entity has a major dictionary list in the json reply.
Works with firmware 1.071.1.6. They may change these values in the future.