{"id":8339,"date":"2025-01-05T22:32:39","date_gmt":"2025-01-05T20:32:39","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=8339"},"modified":"2026-01-04T21:23:23","modified_gmt":"2026-01-04T19:23:23","slug":"je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations","title":{"rendered":"I recover the balance of his bank account and the last operations (in test)"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_91 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-6b0e3a4a98c26\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6b0e3a4a98c26\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Objectif\" >Objective<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_cree_un_compte_Powens\" >I have created a Powens account<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Qui_est_Powens\" >Who is Powens?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_ajoute_un_workspace\" >I added a workspace<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_ajoute_un_domaine\" >I have added an area<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_ajoute_une_application\" >I added an app<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_installe_Postman_pour_Windows\" >I installed Postman for Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_ajoute_un_utilisateur_via_lAPI\" >I added a user via the API<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_obtenu_un_code_temporaire\" >I got a temporary code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_lance_la_Webview_pour_connecter_mon_compte_bancaire\" >I launched the Webview to connect my bank account<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_teste_la_recuperation_du_solde_du_compte\" >I tested the recovery of the account balance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_teste_la_recuperation_des_dernieres_transactions\" >I tested the recovery of the last transactions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_transforme_les_requetes_API_en_capteurs_Home_Assistant\" >I turned API queries into Home Assistant sensors<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Observations_sur_ces_capteurs\" >Observations on these sensors:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jai_ajoute_des_templates_pour_calculer_ce_dont_jai_besoin\" >I added templates to calculate what I need<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Jajoute_une_automatisation_pour_rafraichir_les_donnees\" >I add automation to refresh the data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Je_realise_les_cartes_et_le_screen_du_dashboard\" >I realize the maps and the screen of the dashboard<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-recuperer-le-solde-de-son-compte-bancaire-et-les-dernieres-operations\/#Decomposition_du_dashboard\" >Decomposition of the dashboard<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Objectif\"><\/span>Objective<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>My goal was to connect my bank account to Home Assistant to track my balance and transactions in real time. To do this, I used the Powens API (formerly Budget Insight), a platform that provides free access to bank data in a secure and PSD2 compliant manner.<!--more--><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_cree_un_compte_Powens\"><\/span>I have created a Powens account<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I registered on the Powens website to create an account. Powens offers a banking aggregation solution that allows financial information to be retrieved via APIs. This is perfect for my home automation project.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8307\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens01.png\" alt=\"\" width=\"446\" height=\"589\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens01.png 446w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens01-227x300.png 227w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Qui_est_Powens\"><\/span>Who is Powens?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>Powens<\/strong>\u00a0(formerly Budget Insight) is a leading platform in the field of<strong>banking aggregation<\/strong>\u00a0and<strong>Open Banking<\/strong>. With PSD2 compliant APIs (Payment Services Directive), Powens enables developers and businesses to securely access users\u2019 banking data (with their consent). Their technology is used by fintechs, banks and financial management applications to offer innovative services such as expenditure analysis, transaction categorisation or budget management.<\/p>\n<p>In my case, I use a\u00a0<strong>small part<\/strong>\u00a0Powens' potential via their\u00a0<strong>sandbox<\/strong>, a test environment that allows me to log in to my bank account to retrieve information like balance and latest transactions. This use generates\u00a0<strong>very little traffic<\/strong>\u00a0and stays within the framework of the free offers offered by Powens for developers and small projects. This allows me to integrate this data into my home automation system at no additional cost, while benefiting from the power and reliability of their platform.<\/p>\n<p>I think it is a\u00a0<strong>very good initiative<\/strong>\u00a0from Powens to allow that. By offering free access to their sandbox, they enable home automation hackers like me to experiment and create customised solutions. These hackers, often passionate and influential in their professional or personal circles, can then recommend solid and serious platforms like Powens to wider services or companies. It is a win-win strategy: Powens gains visibility and credibility, while users benefit from a reliable and efficient tool.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_ajoute_un_workspace\"><\/span>I added a workspace<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once connected, I created a new workspace. A workspace is a workspace that brings together my configurations and applications. I named mine <strong>Sigalou-Domotics<\/strong> to keep a clear record of my project.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8308\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens02.png\" alt=\"\" width=\"310\" height=\"117\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens02.png 310w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens02-300x113.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_ajoute_un_domaine\"><\/span>I have added an area<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Then I added a domain to my workspace. This allows configuring the environment for API queries. I chose the domain <strong>sigalou<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8309\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens03.png\" alt=\"\" width=\"401\" height=\"262\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens03.png 401w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens03-300x196.png 300w\" sizes=\"auto, (max-width: 401px) 100vw, 401px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8310\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens04.png\" alt=\"\" width=\"696\" height=\"525\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens04.png 696w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens04-600x453.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens04-300x226.png 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/p>\n<p>The setup took a few minutes. Once completed, I noted that API commands had to be sent to the following address: <strong>https:\/\/sigalou-sandbox.biapi.pro<\/strong>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_ajoute_une_application\"><\/span>I added an app<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The addition of an app is mandatory to establish the connection with my bank account. This application generates unique identifiers (client ID and secret client) that will be used to authenticate API requests.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8312\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06.png\" alt=\"\" width=\"1196\" height=\"576\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06.png 1196w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06-600x289.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06-300x144.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06-1024x493.png 1024w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens06-768x370.png 768w\" sizes=\"auto, (max-width: 1196px) 100vw, 1196px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8316\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens07-1.png\" alt=\"\" width=\"738\" height=\"320\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens07-1.png 738w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens07-1-600x260.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens07-1-300x130.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>This application has provided me with a <strong>Client ID<\/strong> and one <strong>secret client<\/strong>. I have noted them carefully, as they will be needed to create an API user.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_installe_Postman_pour_Windows\"><\/span>I installed Postman for Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To interact with the Powens API, I used Postman, a very handy tool for sending and testing API queries. Postman allows you to simulate API calls and view responses in real time.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8317\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09.png\" alt=\"\" width=\"1099\" height=\"466\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09.png 1099w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09-600x254.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09-300x127.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09-1024x434.png 1024w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens09-768x326.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<ul>\n<li><a href=\"https:\/\/www.postman.com\/downloads\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.postman.com\/downloads\/<\/a><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Jai_ajoute_un_utilisateur_via_lAPI\"><\/span>I added a user via the API<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To create a user, I sent a POST command to the following URL: <strong>https:\/\/sigalou-sandbox.biapi.pro\/2.0\/auth\/init<\/strong>. I used the previously retrieved ID client and secret client.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8305\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens08.png\" alt=\"\" width=\"993\" height=\"446\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens08.png 993w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens08-600x269.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens08-300x135.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens08-768x345.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/p>\n<p>In the body of the application (Body \/ raw \/ JSON), I added:<\/p>\n<div>\n<div>{<\/div>\n<div>\"_id customer\": \"herethe _id_clientrecovered_plus_haut\",<\/div>\n<div>\"_secret customer\": herethe _secret _clientrecovered _plus _haut<\/div>\n<div>}<\/div>\n<\/div>\n<p>In the reply, I noted the <strong>id_user<\/strong> and <strong>auth _token<\/strong>, which will be used for the next steps.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_obtenu_un_code_temporaire\"><\/span>I got a temporary code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This temporary code is necessary to establish the connection with my bank account. To obtain it, I sent a GET command to the following URL: <strong>https:\/\/sigalou-sandbox.biapi.pro\/2.0\/auth\/token\/code?type=singleAccess<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8322\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens10.png\" alt=\"\" width=\"1000\" height=\"520\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens10.png 1000w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens10-600x312.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens10-300x156.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens10-768x399.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<p>I used the <strong>auth _token<\/strong> previously retrieved from Authorization \/ Bearer Token. In the reply, I noted the <strong>code<\/strong> temporary.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_lance_la_Webview_pour_connecter_mon_compte_bancaire\"><\/span>I launched the Webview to connect my bank account<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9355\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/Capture-decran-2025-12-26-191949.png\" alt=\"\" width=\"784\" height=\"388\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/Capture-decran-2025-12-26-191949.png 784w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/Capture-decran-2025-12-26-191949-600x297.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/Capture-decran-2025-12-26-191949-300x148.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/Capture-decran-2025-12-26-191949-768x380.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/p>\n<p>To establish the connection with my bank account, I built the Webview URL in Link Builder and started the connection by clicking on <strong>Open and Test<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8323\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens11.png\" alt=\"\" width=\"438\" height=\"500\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens11.png 438w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens11-263x300.png 263w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_teste_la_recuperation_du_solde_du_compte\"><\/span>I tested the recovery of the account balance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To recover the balance of my account, I sent a GET order to the following URL: <strong>https:\/\/sigalou-sandbox.biapi.pro\/2.0\/users\/1\/accounts<\/strong>, where <strong>1<\/strong> is my id _user.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8325\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens12.png\" alt=\"\" width=\"990\" height=\"631\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens12.png 990w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens12-600x382.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens12-300x191.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens12-768x490.png 768w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/p>\n<p>In the reply, I recovered the balance of my account, which was <strong>599.84\u20ac<\/strong> during my test.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_teste_la_recuperation_des_dernieres_transactions\"><\/span>I tested the recovery of the last transactions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To retrieve the latest transactions, I sent a GET command to the following URL: <strong>https:\/\/sigalou-sandbox.biapi.pro\/2.0\/users\/1\/transactions?limit=10<\/strong>, where <strong>1<\/strong> is my id _user.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8326\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens13.png\" alt=\"\" width=\"1005\" height=\"624\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens13.png 1005w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens13-600x373.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens13-300x186.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens13-768x477.png 768w\" sizes=\"auto, (max-width: 1005px) 100vw, 1005px\" \/><\/p>\n<p>The answer contained a JSON with my last 10 transactions.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Jai_transforme_les_requetes_API_en_capteurs_Home_Assistant\"><\/span>I turned API queries into Home Assistant sensors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To integrate this data into Home Assistant, I created two REST sensors: <strong>_bank transactions<\/strong> and <strong>_bank balance<\/strong>. Here is the code used:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">- platform: rest name: \"_bank transactions\" resource: https:\/\/sigalou-sandbox.biapi.pro\/2.0\/users\/1\/transactions params: limit: 25 headers: Authorization: !secret token_bank scan_interval: 31536000 # Disables automatic updates (1 year) json_attributes: - first_date - last_date - transactions - total value_template: \"{{ now().strftime('%d\/%m\/%Y %H:%M:%S') }}\" - platform: rest name: \"_bank balance\" resource: https:\/\/sigalou-sandbox.biapi.pro\/2.0\/users\/1\/accounts headers: Authorization: !secret token_bank scan_interval: 31536000 # Disables automatic updates value_template: \"{{value_json.balance }}\" unit_of _measurement: \"\u20ac\"<\/pre>\n<p>These sensors are to be placed in the file <strong>sensors.yaml<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8331\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens14.png\" alt=\"\" width=\"689\" height=\"443\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens14.png 689w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens14-600x386.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens14-300x193.png 300w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/p>\n<p>In order for the token to be sent correctly, I added this line to the file <strong>secrets.yaml<\/strong> :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">token_bank: Bearer a8N5q1aUVEa33wl0dCJM...<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8332\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens15.png\" alt=\"\" width=\"729\" height=\"139\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens15.png 729w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens15-600x114.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens15-300x57.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/p>\n<p>Once configured, the sensors appeared in Home Assistant:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8333\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens16.png\" alt=\"\" width=\"782\" height=\"251\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens16.png 782w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens16-600x193.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens16-300x96.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens16-768x247.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Observations_sur_ces_capteurs\"><\/span>Observations on these sensors:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>The refresh is set to 3153600 seconds (approximately 1 year), as I have planned to update the data via daily automation at noon. This will allow me to receive notifications based on the balance or the latest transactions.<\/li>\n<li>Sensors can be simplified. I had initially included data like <strong>first_date<\/strong> and <strong>last_date<\/strong>, but I finally withdrew them because they were not useful in production.<\/li>\n<li>The parameter <strong>limit: 25<\/strong> can be adjusted according to the size of the screen and the card chosen on the dashboard.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Jai_ajoute_des_templates_pour_calculer_ce_dont_jai_besoin\"><\/span>I added templates to calculate what I need<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In the file <strong>templates.yaml<\/strong>, under <strong>sensor<\/strong>, I added these templates:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8336\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens17.png\" alt=\"\" width=\"845\" height=\"364\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens17.png 845w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens17-600x258.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens17-300x129.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens17-768x331.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">- name: \"_a _venir _montant transactions\" state: &gt;- {% set transactions = state_attr('sensor.transactions_bank', 'transactions') %} {% set total = namespace(amount=0) %} {% for transaction in transactions if transaction.coming %} {% set total.amount = total.amount + transaction.value %} {% endfor %} {{ total.amount }} unit _of _measurement: \"\u20ac\" - name: _id single \"available _ balance\": sensor.balance _available unit _of _measurement: \"\u20ac\" state: &gt;- {% set balance = states('sensor.solde _banque') | float %} {% set depenses = states('sensor.transactions _a _venir _montant') | float %} {{ (balance + expenditure) | round(2) }}<\/pre>\n<ul>\n<li>The sensor <strong>_a _venir _montant Transactions<\/strong> calculates the total amount of future transactions (such as scheduled drawdowns).<\/li>\n<li>The sensor <strong>_ balanceavailable<\/strong> calculates the actual balance by subtracting future transactions from the current balance.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Jajoute_une_automatisation_pour_rafraichir_les_donnees\"><\/span>I add automation to refresh the data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>As I explained earlier, I voluntarily deactivated the automatic refresh of the REST sensors by assigning them a very high scan_interval value (31536000 seconds, i.e. about 1 year). This allows me to manually control when data is refreshed, rather than refreshing it every x minutes. This approach is more tailored to my needs, as I plan to use this data to trigger notifications based on my balance or the latest important transactions.<\/p>\n<p>To manage this, I added an automation in Home Assistant that updates my two sensors (<strong>_bank balance<\/strong> and <strong>_bank transactions<\/strong>) every day at noon. Here is the code for this automation:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">alias: Update Bank account description: \"\" Triggers: - trigger: time at: \"12:00:00\" conditions: [] actions: - action: homeassistant.update _entity data: entity_id: - sensor.balance _bank - sensor.transactions _bank mode: single\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8342\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens18.png\" alt=\"\" width=\"389\" height=\"355\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens18.png 389w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/powens18-300x274.png 300w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/p>\n<p>This automation is simple but effective: it triggers an update of the sensors at noon each day. This allows me to keep my data up to date without overloading the API or my system with unnecessary queries. In addition, it gives me the ability to add other actions later, such as sending notifications or running scripts based on the recovered data.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Je_realise_les_cartes_et_le_screen_du_dashboard\"><\/span>I realize the maps and the screen of the dashboard<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>After configuring the sensors and automations, I designed a dashboard in Home Assistant to visualise my banking data in a clear and organised way. Here is the final result of my tests:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8345\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque.png\" alt=\"\" width=\"1285\" height=\"970\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque.png 1285w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque-600x453.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque-300x226.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque-1024x773.png 1024w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2025\/01\/banque-768x580.png 768w\" sizes=\"auto, (max-width: 1285px) 100vw, 1285px\" \/><\/p>\n<p>Here is the complete code of the page, which I will break down to explain each part:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">Type: max _columns sections: 4 path: ss sections: - type: grid cards: - type: entity entity: sensor.solde _bank name: Bank balance icon: mdi:bank-transfer grid_options: columns: full card_mod: style: | ha-card { padding: 4px; border-radius: 15px; } .icon ha-state-icon { --mdc-icon-size: 50px!important; \/* Icon size *\/ margin-bottom: 10px; } - type: markdown content: &amp;gt; {% set transactions = state_attr(&#039;sensor.transactions_bank&#039;, &#039;transactions&#039;) %} ## TODAY {% for transaction in transactions %} {% if not transaction.coming %} {% if transaction.date %} {% set date_obj = transaction.date | as_datetime %} {% set formatted _date = date_obj.strftime(&#039;%d\/%m\/%Y&#039;) %} {% else %} {% set formatted _date = &#039;Date unknown&#039; %} {% endif %} {% if transaction.type == &#039;card&#039; %\ud83d\udcb3 {{ formatted _date }} {% elif transaction.type == &#039;bank&#039; %} \ud83c\udfe6 {{ formatted _date }} {% elif transaction.type == &#039;check&#039; %} \ud83d\udcdd {{ formatted _date }} {% elif transaction.type == &#039;transfer&#039; %\ud83d\udcb8 {{ formatted _date }} {% else %\u26aa {{ formatted _date }} {% endif %}\r\n              &lt;strong&gt;\r\n                {% if transaction.value &amp;gt; 0 %} \ud83d\udfe2 {{ transaction.formatted _value }} {% else %} \ud83d\udd34 {{ transaction.formatted _value }} {% endif %}\r\n              &lt;\/strong&gt;\r\n              &lt;small&gt;{{transaction.wording }}&lt;\/small&gt;\r\n            {% endif %} {% endfor %} grid _options: columns: 24 rows: auto - type: vertical-stack cards: - type: markdown content: &amp;gt; {% set transactions = state_attr(&#039;sensor.transactions_bank&#039;, &#039;transactions&#039;) %} ## FUTURE {{ states(&#039;sensor.transactions _a_venir _montant&#039;) |float |round(2) }} &euro; {% for transaction in transactions %} {% if transaction.coming %} {% if transaction.date %} {% set date_obj = transaction.date | as_datetime %} {% set formatted _date = date_obj.strftime(&#039;%d\/%m\/%Y&#039;) %} {% else %} {% set formatted _date = &#039;Date unknown&#039; %} {% endif %} {% if transaction.type == &#039;card&#039; %\ud83d\udcb3 {{ formatted _date }} {% elif transaction.type == &#039;bank&#039; %} \ud83c\udfe6 {{ formatted _date }} {% elif transaction.type == &#039;check&#039; %} \ud83d\udcdd {{ formatted _date }} {% elif transaction.type == &#039;transfer&#039; %\ud83d\udcb8 {{ formatted _date }} {% else %\u26aa {{ formatted _date }} {% endif %} {% if transaction.value &amp;gt; 0 %} \ud83d\udfe2 {{ transaction.formatted _value }} - {{ transaction.wording }} {% else %} \ud83d\udd34 {{ transaction.formatted _value }} - {{ transaction.wording }} {% endif %} {% endif %} {% endfor %} grid _options: columns: 12 rows: auto - type: entity entity: sensor.solde _available name: Available balance icon: mdi:bank-transfer grid_options: columns: full card_mod: style: | ha-card { padding: 4px; border-radius: 15px; } .icon ha-state-icon { --mdc-icon-size: 50px!important; \/* Icon size *\/ margin-bottom: 10px; } - type: entities entities: - entity: sensor.transactions _bank name: Last update of data format: datetime column _span: 3 cards: [] icon: mdi:currency-eur\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Decomposition_du_dashboard\"><\/span>Decomposition of the dashboard<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>My dashboard is structured in several sections and maps to display information in a clear and intuitive way. Here's what each card does:<\/p>\n<h4>1. \"Bank balance\" card<\/h4>\n<p>This card shows the current balance of my bank account. It uses the sensor <strong>sensor.balance _bank<\/strong> and includes a stylized icon (<strong>mdi:bank-transfer<\/strong>) for better visibility. I added a custom style to round the corners of the map and enlarge the icon.<\/p>\n<h4>2. \u2018AUJOURD\u2019HUI\u2019 card<\/h4>\n<p>This card shows the transactions made today. It uses a Markdown template to format the data:<\/p>\n<ul>\n<li>Transactions are classified by type (\ud83d\udcb3 for cards, \ud83c\udfe6 for transfers, etc.).<\/li>\n<li>The amounts are displayed in green (\ud83d\udfe2) for credits and in red (\ud83d\udd34) for debits.<\/li>\n<li>The date of each transaction is formatted in the format <strong>dd\/mm\/yyyy<\/strong>.<\/li>\n<\/ul>\n<h4>3. \"FUTURE\" card<\/h4>\n<p>This card shows upcoming transactions (such as scheduled direct debits). It also uses a Markdown template:<\/p>\n<ul>\n<li>The total amount of future transactions is displayed at the top of the card.<\/li>\n<li>Each transaction is listed with its type, date and amount.<\/li>\n<\/ul>\n<h4>4. \"Available balance\" card<\/h4>\n<p>This card shows the available balance after deduction of future transactions. It uses the sensor <strong>sensor.balance _available<\/strong> and shares the same style as the \"Bank Balance\" card.<\/p>\n<h4>5. Map \"Last data update\"<\/h4>\n<p>This card shows the date and time of the last update of the bank details. It uses the sensor <strong>sensor.transactions _bank<\/strong> and format the date in format <strong>datetime<\/strong>.<\/p>","protected":false},"excerpt":{"rendered":"<p>My goal was to connect my bank account to Home Assistant to track my balance and transactions in real time. To do this, I used the Powens API (formerly Budget Insight), a platform that provides free access to bank data in a secure and PSD2 compliant manner.<\/p>","protected":false},"author":1,"featured_media":8329,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,166],"tags":[],"class_list":["post-8339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-retex"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/8339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=8339"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/8339\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media\/8329"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=8339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=8339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=8339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}