Another XML Scrape help question

I want to get the temp and a few others on to a dashboard.
Help please.

This is the xml page

<?xml version="1.0" encoding="windows-1250" ?>
<?xml-stylesheet type="text/xsl" href="HOME.XSL?U=1588753443" version="1.0" ?>
<PAGE TITLE="                                  ">
<ACCESS PAGE_LEVEL="0" USER_LEVEL="0" UCID="1588753443" />
<INPUT NAME="__R3189_TIME_Thh:mm:ss" VALUE="02:00:00" />
<INPUT NAME="__R37954_TIME_Thh:mm:ss" VALUE="00:10:00" />
<INPUT NAME="__R4008.0_BOOL_i" VALUE="1" />
<INPUT NAME="__R79565.0_BOOL_i" VALUE="0" />
<INPUT NAME="__R79565.1_BOOL_i" VALUE="0" />
<INPUT NAME="__R3159.0_BOOL_i" VALUE="0" />
<INPUT NAME="__R79564.6_BOOL_i" VALUE="0" />
<INPUT NAME="__R79564.7_BOOL_i" VALUE="0" />
<INPUT NAME="__R37958.1_BOOL_i" VALUE="1" />
<INPUT NAME="__R24863.0_BOOL_i" VALUE="0" />
<INPUT NAME="__R5439.1_BOOL_i" VALUE="1" />
<INPUT NAME="__R2357.1_BOOL_i" VALUE="1" />
<INPUT NAME="__R22657_REAL_.1f" VALUE="27.2" />
<INPUT NAME="__R22661_REAL_.1f" VALUE="0.0" />
<INPUT NAME="__R2357.0_BOOL_i" VALUE="1" />
<INPUT NAME="__R22655.1_BOOL_i" VALUE="0" />
<INPUT NAME="__R40551_REAL_.1f" VALUE="22.0" />
<INPUT NAME="__R79561.0_BOOL_i" VALUE="0" />
<INPUT NAME="__R79561.1_BOOL_i" VALUE="0" />
<INPUT NAME="__R2398_STRING[15]_s" VALUE="UFH Down" />
</PAGE>

Have you Googled “home assistant scrape XML”? This give you various sources of topics on this community on the same subject.

I have and none of them work.

I can imagine, the xml-data you show is not real xml.
I don’t know how the Scrape integration works but I think you need to first look for the complete content of 1 line: INPUT NAME="__R22657_REAL_.1f" VALUE="27.2" and then via a second step (value_template?) obtain the number 27.2.

Thank you but, not sure how to do that. :frowning:

Please look at this topic for inspiration: RESTful and XML Integration

The xml-data in that topic looks like your xml-data.

I have seen this page and I did try some of it, there is allot. I will try again and reply. Thank you

Not having much luck. I have this code but every time I make a change it kills HomeAssitant and I have to restore from a snapshot.
sensor:

Any ideas?

Please look it this post: RESTful and XML Integration - #22 by Reijer and the post above. This looks a bit like what you have/want.

I think you need not to write name: but value_template: '{{ value_json[...][...] }}' like in the example I link above.

And the trick is to find the correct strings to put between the [ ]'s.

1 Like

OK i have tried this
sensor:

  • platform: rest
    name: Steam System Data
    resource: http://192.168.14.232/login.xml
    username: user
    password: 1Desmonddo
    authentication: basic
    value_json[“INPUT”]["-NAME"]["-NAME"][?(@["-VALUE"]=="_R22657_REAL.1f")]["@Value"]

But I keep getting this

 can not read an implicit mapping pair; a colon is missed at line 21, column 89:
     ... ="__R22657_REAL_.1f")]["@Value"]
                                         ^

Arrow inditcating the underscore after “REAL”
any ideas?

I think it should look like this:
`

value_template: '{{ value_json [“INPUT”]["-NAME"]["-NAME"][?(@["-VALUE"]=="_*R22657_REAL* .1f")]["@Value"] }}'

I’ve used the XML to JSON converter that is in the first post of the example thread, after some rearranging, the result is this:

{"PAGE":
	{
		"@TITLE":"                                  ",
		"ACCESS": 
			{
				"@PAGE_LEVEL":"0",
                "@UCID":"1588753443",
				"@USER_LEVEL":"0"
			},
		"INPUT":
			[
				{"@NAME":"__R3189_TIME_Thh:mm:ss","@VALUE":"02:00:00"},
				{"@NAME":"__R37954_TIME_Thh:mm:ss","@VALUE":"00:10:00"},
				{"@NAME":"__R4008.0_BOOL_i","@VALUE":"1"},
				{"@NAME":"__R79565.0_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R79565.1_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R3159.0_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R79564.6_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R79564.7_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R37958.1_BOOL_i","@VALUE":"1"},
				{"@NAME":"__R24863.0_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R5439.1_BOOL_i","@VALUE":"1"},
				{"@NAME":"__R2357.1_BOOL_i","@VALUE":"1"},
				{"@NAME":"__R22657_REAL_.1f","@VALUE":"27.2"},
				{"@NAME":"__R22661_REAL_.1f","@VALUE":"0.0"},
				{"@NAME":"__R2357.0_BOOL_i","@VALUE":"1"},
				{"@NAME":"__R22655.1_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R40551_REAL_.1f","@VALUE":"22.0"},
				{"@NAME":"__R79561.0_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R79561.1_BOOL_i","@VALUE":"0"},
				{"@NAME":"__R2398_STRING[15]_s","@VALUE":"UFH Down"}
			]
	}
}

Based on this I think it should be something like: {{ value_json ["PAGE"]["INPUT"][?(@["NAME"]=="_*R22657_REAL* .1f")]["@Value"] }}