From 35224e33f7c078c08c3408f88793f8bdf58f9d44 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 20 Mar 2020 08:52:51 -0400 Subject: [PATCH] Add method to return 'hass' object from browser console to docs (#368) * Add method to return 'hass' object from browser console * better grammar * add warning about accessing hass property and update call per bram's suggestion * Update frontend_data.md --- docs/frontend_data.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/frontend_data.md b/docs/frontend_data.md index 14730220..74223538 100644 --- a/docs/frontend_data.md +++ b/docs/frontend_data.md @@ -11,6 +11,14 @@ Whenever a state changes, a new version of the objects that changed are created. const changed = newVal !== oldVal; ``` +In order to see the data available in the `hass` object, visit your HomeAssistant frontend in your favorite browser and open the browser's developer tools. On the elements panel, select the `` element, or any other element that has the `hass` property, and then run the following command in the console panel: + +```js +$0.hass +``` + +This method of reading the `hass` object should only be used as a reference. In order to interact with `hass` in your code, make sure it is passed to your code correctly. + ## Data ### `hass.states`