-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Most sensors do not populate #3
Comments
I've got the same issue. I made a quick script to test monarch money portion of the code (not sure how you properly test a home assistant sensor in isolation) and it returns all the expect data. Still trying to narrow it down but looks right now it seems like a sensor write issue. from monarchmoney import MonarchMoney
mm = MonarchMoney()
ATTR_ASSETS = "ASSETS"
ATTR_LIABILITIES = "LIABILITIES"
ATTR_BROKERAGE = "Investments"
ATTR_CREDIT = "Credit Cards"
ATTR_DEPOSITORY = "Cash"
ATTR_LOAN = "Loans"
ATTR_OTHER = "Other"
ATTR_REAL_ESTATE = "Real Estate"
ATTR_VALUABLE = "Valuables"
ATTR_VEHICLE = "Vehicles"
ATTR_OTHER_ASSET = "Other Assets"
ATTR_OTHER_LIABILITY = "Other Liabilities"
SENSOR_TYPES_GROUP = {
ATTR_BROKERAGE: {
"type": "brokerage",
"group": ATTR_ASSETS,
"icon": "mdi:chart-line",
},
ATTR_CREDIT: {
"type": "credit",
"group": ATTR_LIABILITIES,
"icon": "mdi:credit-card",
},
ATTR_DEPOSITORY: {"type": "depository", "group": ATTR_ASSETS, "icon": "mdi:cash"},
ATTR_LOAN: {"type": "loan", "group": ATTR_LIABILITIES, "icon": "mdi:bank"},
ATTR_OTHER: {"type": "other", "group": "OTHER", "icon": "mdi:information-outline"},
ATTR_REAL_ESTATE: {"type": "real_estate", "group": ATTR_ASSETS, "icon": "mdi:home"},
ATTR_VALUABLE: {
"type": "valuables",
"group": ATTR_ASSETS,
"icon": "mdi:treasure-chest",
},
ATTR_VEHICLE: {"type": "vehicle", "group": ATTR_ASSETS, "icon": "mdi:car"},
ATTR_OTHER_ASSET: {
"type": "other_asset",
"group": ATTR_ASSETS,
"icon": "mdi:file-document-outline",
},
ATTR_OTHER_LIABILITY: {
"type": "other_liability",
"group": ATTR_LIABILITIES,
"icon": "mdi:account-alert-outline",
},
}
def balances(accounts, category):
account_type = SENSOR_TYPES_GROUP[category]["type"]
account_data = {}
sensor_type_accounts = [
account
for account in accounts
if account.get("type").get("name") == account_type
]
for account in sensor_type_accounts:
institution = None
try:
institution = account.get("credential").get("institution").get("name", "")
except AttributeError:
pass
account_data[account.get("id", "")] = {
"id": account.get("id", ""),
"name": account.get("displayName", ""),
"balance": account.get("displayBalance", ""),
"account_type": account.get("type").get("name", ""),
"institution": institution,
}
sensor_type_accounts_sum = round(
sum(
sensor_type_account["displayBalance"]
for sensor_type_account in sensor_type_accounts
)
)
print(category)
print(sensor_type_accounts_sum)
#print(account_data)
def net_worth(accounts):
print("=======================")
print("Net worth")
print("=======================")
active_accounts = [
account for account in accounts if account["includeInNetWorth"] is True
]
asset_accounts = [
account
for account in active_accounts
if account["isAsset"] is True
# and account["type"]["name"] in ASSET_ACCOUNT_TYPES
]
liability_accounts = [
account
for account in accounts
if account["isAsset"] is False
# and account["type"]["name"] in LIABILITY_ACCOUNT_TYPES
]
asset_accounts_sum = round(
sum(asset_account["displayBalance"] for asset_account in asset_accounts)
)
liability_accounts_sum = round(
sum(
liability_account["displayBalance"]
for liability_account in liability_accounts
)
)
active_accounts_sum = asset_accounts_sum - liability_accounts_sum
print(active_accounts_sum)
print(asset_accounts_sum)
print(liability_accounts_sum)
async def login_to_monarch(email, password):
await mm.login(email, password)
data = await mm.get_accounts()
accounts = data["accounts"]
net_worth(accounts)
categories = SENSOR_TYPES_GROUP.keys()
print("=======================")
print("Balances")
print("=======================")
for category in categories:
balances(accounts, category)
import asyncio
EMAIL=""
PASSWORD=""
asyncio.run(login_to_monarch(EMAIL, PASSWORD)) |
Thanks for looking into this - curious to see what you find. |
The default update interval is 1 hour. Can you check if it updates in 1 hour or not? |
I've changed it between 30mins and 1hr doesn't seem to change the sensor. The state doesn't seem to persist either when I alter the settings but i suspect that might be an artifact of HACs or HA. It's strange be because the net worth sensor is accurate and updates but all other sensors are 0. Running:
|
Also having the same issue. |
Just installed and having the same issue. All 0's except Net Worth. |
I'm wondering if there is a problem with the repo? Downloading through HACs does not bring back the most recent code changes made two weeks ago. If I download the whole repo and drop it in HA I get a 'failed to initialize' error. If I just selectively use the latest sensor.py, config_flow.py & update_coordinator.py the integration initializes but then again, all sensor except net_worth are 0. |
HACS expects we publish a new release in github, I just did that. See if you can pull latest release and if it fixes the issue |
Completely deleted the integration & started over in HACs. Looks like it grabbed the 0.0.2 release, which is good, however now it's caught in loop of "Failed setup, will retry" & "Initializing". Nothing in the log. |
Same issue as @elstevega |
1 similar comment
Same issue as @elstevega |
Ok - some updates: '# self._state = c.get("summary").get("savings")
and in update_coordinator.py comment out lines 109-110 Seems Monarch doesn't like the get_cashflow() API call Now I'm getting data for Cash, Credit, Net Worth & Vehicles. Monarch Loans, Monarch Other, Monarch Other Assets, Monarch Other Liabilities, Monarch Real Estate, Monarch Valuables are all still $0.00 - but that may be correct as I don't have any data that fits those categories. (edit: not true as I have a ton of investment accounts - not sure which bucket they should be in...) |
Can you please update to the latest release (0.0.3) and report if it's still an issue? |
It works! Thank you! |
I can't get past authentication. Anyone having that issue?
…On Sun, Jun 30, 2024, 9:43 AM defkon ***@***.***> wrote:
It works! Thank you!
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJXIGPVNWJY2BZP3JMREHCLZKAKPJAVCNFSM6AAAAABCLA37IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGU4DKMZXGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Just installed, same thing, most sensors do not update. I have installed 0.0.3, but: "version": "0.0.1", Is still listed in the manifest.json. I notice even in the source code, that this is set to 0.0.1, for the 0.0.3 tag. |
The only sensor that is retrieving data from Monarch Money is 'Net Worth'. All the others are coming back as 0.
The text was updated successfully, but these errors were encountered: