MarkBryanMilligan / LanternPowerMonitor

The Lantern Power Monitor is a Raspberry Pi service, Java Web Service, and Android application that allow you to monitor every electrical breaker in your house, regardless of how many panels or breakers you have.
GNU General Public License v3.0
80 stars 26 forks source link

Firetab Bug #21

Closed sicXnull closed 2 years ago

sicXnull commented 2 years ago

Heads up. Looks like there may be a potential bug when using this on the newest firetab. I keep getting the "turn on location services" error, despite them being on.

Screenshot_20211009-163857 Screenshot_20211009-163948

MarkBryanMilligan commented 2 years ago

Are you sure you have your location services on? I see you've got bluetooth scanning on, but like the dialog says, android now requires the "use location" option to be turned on as well. I don't understand android's reasoning behind it, and I don't have any control over it.

If you have location services on and it's still not working, then yeah, it might be a problem with the Firetab specifically. Try turning on location services even before going in to add your hub. If it still doesn't work, let me know and I'll try to get an emulator going to see if I can replicate it.

sicXnull commented 2 years ago

Unless I am missing something, i'm fairly sure every option is turned on.

tbh i mainly just want to get it set up for hassio and grafana stats. Is it possible to set this up without configuring through the app? i added the MQTT info you listed here, but my broker is still not receiving any data. no errors in debug

Screenshot_20211009-204447 Screenshot_20211009-205106 Screenshot_20211009-204507 Screenshot_20211009-204552 Screenshot_20211009-205042

MarkBryanMilligan commented 2 years ago

Yeah, you can go modify the config.json at /opt/currentmonitor on the hub and specify the mqtt_breakers field in the json to run completely headless. There's no doc on this, but if you go look at https://github.com/MarkBryanMilligan/LanternPowerMonitor/blob/main/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/dao/MonitorConfigSerializer.java, you can probably figure it out.

MarkBryanMilligan commented 2 years ago

This is the block of code where I check if location services is enabled:

if ((locManager != null) && !locManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { dialog(R.string.location, R.string.location_request, ()->{ Intent enableLocIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivityForResult(enableLocIntent, ENABLE_LOC_REQUEST_CODE); }, this::finish); return; }

Apparently on Amazon devices, I need to check for NETWORK_PROVIDER instead of GPS_PROVIDER. I'll try to get a workaround added and released this week. I think you'll be better off getting it configured in the app instead of messing around in json files. If you get that working and use the actual app, I think you'll get a lot more out of the app than what Home Assistant can offer, but ideally you'll be able to use both.

sicXnull commented 2 years ago

Cool thanks! Ideally, I would like to use both.