# system.kanoa.event.addStateEvent(stateInfo, userId)

Adds a stateEvent record. All stateInfo keys are required.

---
### Parameters
**stateInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - assetId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - assetStateId</td><td>Integer</td><td>Can set this to a sub asset if asset is down due to a downtime fault on a child cell otherwise set to assetId</td></tr>	
 	<tr><td> - note</td><td>String</td><td></td></tr>	
 	<tr><td> - stateCode</td><td>Integer</td><td></td></tr>	
 	<tr><td> - tStamp</td><td>String</td><td></td></tr>	
	</tbody>
</table>

**userId** `Integer`: Id of user executing the function<br />

---
### Returns
**stateEventId** `Dictionary`<br />

---
### Example
```python
stateInfo = {'assetId': 18, 'assetStateId': 18, 'stateCode': 1, 'tStamp': system.date.now(), 'note': None}
userId = 123
stateInfo = system.kanoa.event.addStateEvent(stateInfo, userId)
```
